ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2017-04-07 12:50:02 UTC], ["updated_at", 2017-04-07 12:50:02 UTC]]  (0.4ms) COMMIT ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]] ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]] ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]  (197.9ms) DROP DATABASE IF EXISTS "dummy_test"  (504.4ms) CREATE DATABASE "dummy_test" ENCODING = 'unicode'  (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)  (25.6ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.2ms) SELECT pg_try_advisory_lock(2735718569030447490); ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreatePushTypeUsers (20170407125007)  (0.1ms) BEGIN SQL (3.4ms) CREATE EXTENSION IF NOT EXISTS "uuid-ossp"  (2.1ms) CREATE TABLE "push_type_users" ("id" uuid DEFAULT uuid_generate_v4() PRIMARY KEY, "name" character varying, "email" character varying, "field_store" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170407125007"]]  (0.6ms) COMMIT Migrating to CreatePushTypeNodes (20170407125008)  (0.1ms) BEGIN  (2.2ms) CREATE TABLE "push_type_nodes" ("id" uuid DEFAULT uuid_generate_v4() PRIMARY KEY, "type" character varying, "title" character varying, "slug" character varying, "field_store" jsonb, "parent_id" uuid, "sort_order" integer, "status" integer, "published_at" timestamp, "published_to" timestamp, "creator_id" uuid, "updater_id" uuid, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "deleted_at" timestamp) SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170407125008"]]  (0.5ms) COMMIT Migrating to CreatePushTypeNodeHierarchies (20170407125009)  (0.1ms) BEGIN  (0.5ms) CREATE TABLE "push_type_node_hierarchies" ("ancestor_id" uuid NOT NULL, "descendant_id" uuid NOT NULL, "generations" integer NOT NULL)  (0.9ms) CREATE UNIQUE INDEX "node_anc_desc_idx" ON "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations")  (0.5ms) CREATE INDEX "node_desc_idx" ON "push_type_node_hierarchies" ("descendant_id") SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170407125009"]]  (0.5ms) COMMIT Migrating to CreatePushTypeAssets (20170407125010)  (0.1ms) BEGIN  (2.3ms) CREATE TABLE "push_type_assets" ("id" uuid DEFAULT uuid_generate_v4() PRIMARY KEY, "file_uid" character varying, "file_name" character varying, "file_size" integer, "file_ext" character varying, "mime_type" character varying, "description" character varying, "uploader_id" uuid, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "deleted_at" timestamp) SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170407125010"]]  (0.4ms) COMMIT Migrating to AddFieldStoreDefaultValues (20170407125011)  (0.1ms) BEGIN  (0.3ms) ALTER TABLE "push_type_nodes" ALTER COLUMN "field_store" TYPE jsonb  (0.2ms) ALTER TABLE "push_type_nodes" ALTER COLUMN "field_store" SET DEFAULT '{}'  (0.3ms) UPDATE "push_type_nodes" SET "field_store"='{}' WHERE "field_store" IS NULL  (0.1ms) ALTER TABLE "push_type_nodes" ALTER "field_store" SET NOT NULL  (0.2ms) ALTER TABLE "push_type_users" ALTER COLUMN "field_store" TYPE jsonb  (0.1ms) ALTER TABLE "push_type_users" ALTER COLUMN "field_store" SET DEFAULT '{}'  (0.5ms) UPDATE "push_type_users" SET "field_store"='{}' WHERE "field_store" IS NULL  (0.3ms) ALTER TABLE "push_type_users" ALTER "field_store" SET NOT NULL SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170407125011"]]  (0.4ms) COMMIT Migrating to DropLegacyPushTypeTaxonomies (20170407125012)  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170407125012"]]  (0.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2017-04-07 12:50:10 UTC], ["updated_at", 2017-04-07 12:50:10 UTC]]  (0.4ms) COMMIT  (0.1ms) SELECT pg_advisory_unlock(2735718569030447490) ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations" Creating scope :published. Overwriting existing method PushType::Node.published.  (0.1ms) BEGIN  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "push_type_users" DISABLE TRIGGER ALL;ALTER TABLE "push_type_nodes" DISABLE TRIGGER ALL;ALTER TABLE "push_type_node_hierarchies" DISABLE TRIGGER ALL;ALTER TABLE "push_type_assets" DISABLE TRIGGER ALL  (0.1ms) COMMIT  (1.0ms)  SELECT schemaname || '.' || tablename FROM pg_tables WHERE tablename !~ '_prt_' AND tablename <> 'schema_migrations' AND schemaname = ANY (current_schemas(false))   (1.0ms) select table_name from information_schema.views where table_schema = 'dummy_test'  (29.1ms) TRUNCATE TABLE "public"."ar_internal_metadata", "public"."push_type_users", "public"."push_type_nodes", "public"."push_type_node_hierarchies", "public"."push_type_assets" RESTART IDENTITY CASCADE;  (0.1ms) BEGIN  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "push_type_node_hierarchies" ENABLE TRIGGER ALL;ALTER TABLE "push_type_assets" ENABLE TRIGGER ALL;ALTER TABLE "push_type_users" ENABLE TRIGGER ALL;ALTER TABLE "push_type_nodes" ENABLE TRIGGER ALL  (0.1ms) COMMIT  (0.1ms) BEGIN ----------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::POST #create::with in-valid user: test_0001_anonymous -----------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::UsersController#create as JSON Parameters: {"user"=>{}}  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.4ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 25ms (Views: 0.2ms | ActiveRecord: 2.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::POST #create::with in-valid user: test_0002_anonymous -----------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::UsersController#create as JSON Parameters: {"user"=>{}}  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.3ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::PUT #update::with in-valid user: test_0001_anonymous ----------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-1@example.com"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-1@example.com"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#update as JSON Parameters: {"user"=>{"name"=>""}, "id"=>"7408ef69-f3f7-40fe-9cff-90bec660f72e"} PushType::User Load (0.2ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "7408ef69-f3f7-40fe-9cff-90bec660f72e"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 AND ("push_type_users"."id" != $2) LIMIT $3 [["email", "joe-1@example.com"], ["id", "7408ef69-f3f7-40fe-9cff-90bec660f72e"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 4ms (Views: 0.1ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::PUT #update::with in-valid user: test_0002_anonymous ----------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-2@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-2@example.com"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#update as JSON Parameters: {"user"=>{"name"=>""}, "id"=>"f631ffbe-fd6f-4140-b20f-766c7b1cab15"} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "f631ffbe-fd6f-4140-b20f-766c7b1cab15"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 AND ("push_type_users"."id" != $2) LIMIT $3 [["email", "joe-2@example.com"], ["id", "f631ffbe-fd6f-4140-b20f-766c7b1cab15"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #create::with in-valid node: test_0001_anonymous -----------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-1"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-1"], ["status", 0], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta467d1b49bece6d2cf94924bfd6ba591 SQL (0.3ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "92566a0a-2aee-4b44-b272-05683706af00"], ["descendant_id", "92566a0a-2aee-4b44-b272-05683706af00"], ["generations", 0]]  (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "92566a0a-2aee-4b44-b272-05683706af00"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "92566a0a-2aee-4b44-b272-05683706af00"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "92566a0a-2aee-4b44-b272-05683706af00"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t4be6ac06cb3043369ca45f98429f019b  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') Processing by PushType::Api::NodesController#create as JSON Parameters: {"node"=>{}}  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" IS NULL AND "push_type_nodes"."parent_id" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 5ms (Views: 0.2ms | ActiveRecord: 0.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #create::with in-valid node: test_0002_anonymous -----------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-2"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-2"], ["status", 0], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8181b4826ad7b3e26942fa753e6abb18 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "a7f55401-f973-4de5-a211-427f1de9536c"], ["descendant_id", "a7f55401-f973-4de5-a211-427f1de9536c"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a7f55401-f973-4de5-a211-427f1de9536c"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "a7f55401-f973-4de5-a211-427f1de9536c"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "a7f55401-f973-4de5-a211-427f1de9536c"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8172742bf9c14ff88c0eaf75ae65a6fb  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') Processing by PushType::Api::NodesController#create as JSON Parameters: {"node"=>{}}  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" IS NULL AND "push_type_nodes"."parent_id" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 3ms (Views: 0.1ms | ActiveRecord: 0.3ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::PUT #update::with valid user: test_0001_anonymous -------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-3@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-3@example.com"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#update as JSON Parameters: {"user"=>{"name"=>"Foo bar baz"}, "id"=>"b14aac76-033a-4015-85de-93737b26c7b2"} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "b14aac76-033a-4015-85de-93737b26c7b2"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 AND ("push_type_users"."id" != $2) LIMIT $3 [["email", "joe-3@example.com"], ["id", "b14aac76-033a-4015-85de-93737b26c7b2"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_users" SET "name" = $1, "updated_at" = $2 WHERE "push_type_users"."id" = $3 [["name", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "b14aac76-033a-4015-85de-93737b26c7b2"]]  (0.3ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.4ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (5.2ms) Completed 200 OK in 27ms (Views: 23.8ms | ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::PUT #update::with valid user: test_0002_anonymous -------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.3ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-4@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-4@example.com"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#update as JSON Parameters: {"user"=>{"name"=>"Foo bar baz"}, "id"=>"2d4b3d7b-26c5-4815-92b9-3a08597c48be"} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "2d4b3d7b-26c5-4815-92b9-3a08597c48be"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.3ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 AND ("push_type_users"."id" != $2) LIMIT $3 [["email", "joe-4@example.com"], ["id", "2d4b3d7b-26c5-4815-92b9-3a08597c48be"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_users" SET "name" = $1, "updated_at" = $2 WHERE "push_type_users"."id" = $3 [["name", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "2d4b3d7b-26c5-4815-92b9-3a08597c48be"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.4ms) Completed 200 OK in 9ms (Views: 0.8ms | ActiveRecord: 0.7ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::PUT #update::with valid user: test_0003_anonymous -------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-5@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-5@example.com"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#update as JSON Parameters: {"user"=>{"name"=>"Foo bar baz"}, "id"=>"9c759954-62bb-43b8-8fba-c91883844e2c"} PushType::User Load (0.2ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "9c759954-62bb-43b8-8fba-c91883844e2c"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 AND ("push_type_users"."id" != $2) LIMIT $3 [["email", "joe-5@example.com"], ["id", "9c759954-62bb-43b8-8fba-c91883844e2c"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_users" SET "name" = $1, "updated_at" = $2 WHERE "push_type_users"."id" = $3 [["name", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "9c759954-62bb-43b8-8fba-c91883844e2c"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.5ms) Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN --------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::PUT #update::with valid asset: test_0002_anonymous ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "1"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#update as JSON Parameters: {"asset"=>{"description"=>"Foo bar baz"}, "id"=>"a73fadd6-d91e-43a6-9420-f356a9198c3a"} PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "a73fadd6-d91e-43a6-9420-f356a9198c3a"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "description" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["description", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "a73fadd6-d91e-43a6-9420-f356a9198c3a"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.5ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (2.4ms) Completed 200 OK in 13ms (Views: 9.7ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::PUT #update::with valid asset: test_0001_anonymous ---------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "2"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#update as JSON Parameters: {"asset"=>{"description"=>"Foo bar baz"}, "id"=>"97a5c450-f1f1-4b74-b995-ed4194973e9d"} PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "97a5c450-f1f1-4b74-b995-ed4194973e9d"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "description" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["description", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "97a5c450-f1f1-4b74-b995-ed4194973e9d"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::PUT #update::with valid asset: test_0003_anonymous ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "3"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#update as JSON Parameters: {"asset"=>{"description"=>"Foo bar baz"}, "id"=>"2b9f5535-6ff5-425b-89d3-a726c4653b53"} PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "2b9f5535-6ff5-425b-89d3-a726c4653b53"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "description" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["description", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "2b9f5535-6ff5-425b-89d3-a726c4653b53"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #update::with valid node: test_0001_anonymous -------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-3"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-3"], ["status", 0], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2ec616622ad986bec09844dcb7fb7d33 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"], ["descendant_id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t2bc0a53be50a0d4ef8835ef75739d5d3  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#update as JSON Parameters: {"node"=>{"title"=>"Foo bar baz"}, "id"=>"a2302901-c81f-45db-97d7-f6a1594f0cdf"} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-3"], ["id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "title" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["title", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"]]  (0.3ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "a2302901-c81f-45db-97d7-f6a1594f0cdf"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (12.0ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (14.2ms) Completed 200 OK in 26ms (Views: 21.1ms | ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #update::with valid node: test_0002_anonymous -------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-4"], ["status", 0], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t0282aeedffe9b44a921caa6d241d0f5a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"], ["descendant_id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb05a2e6a549c5a7b38aa09641636d7b6  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#update as JSON Parameters: {"node"=>{"title"=>"Foo bar baz"}, "id"=>"a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"} PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-4"], ["id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "title" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["title", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "a7fd9a19-61e5-41c0-a9a9-7944c7f60ee8"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.9ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.3ms) Completed 200 OK in 9ms (Views: 4.3ms | ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #update::with valid node: test_0003_anonymous -------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-5"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-5"], ["status", 0], ["created_at", 2017-04-07 12:50:14 UTC], ["updated_at", 2017-04-07 12:50:14 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t6d0dd0d8f58a25916b85cea2f5439672 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "4b26392a-1c85-4074-bcf9-290f337eec3d"], ["descendant_id", "4b26392a-1c85-4074-bcf9-290f337eec3d"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "4b26392a-1c85-4074-bcf9-290f337eec3d"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "4b26392a-1c85-4074-bcf9-290f337eec3d"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "4b26392a-1c85-4074-bcf9-290f337eec3d"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t155069c8c98e0a157fe7b81be3735590  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#update as JSON Parameters: {"node"=>{"title"=>"Foo bar baz"}, "id"=>"4b26392a-1c85-4074-bcf9-290f337eec3d"} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "4b26392a-1c85-4074-bcf9-290f337eec3d"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-5"], ["id", "4b26392a-1c85-4074-bcf9-290f337eec3d"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "push_type_nodes" SET "title" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["title", "Foo bar baz"], ["updated_at", 2017-04-07 12:50:14 UTC], ["id", "4b26392a-1c85-4074-bcf9-290f337eec3d"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "4b26392a-1c85-4074-bcf9-290f337eec3d"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "4b26392a-1c85-4074-bcf9-290f337eec3d"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.9ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.3ms) Completed 200 OK in 10ms (Views: 4.1ms | ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ------------------------------------------------------------------- PushType::Api::UsersControllerTest::GET #index: test_0003_anonymous -------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-6@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-6@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-7@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-7@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-8@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-8@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-9@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-9@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-10@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-10@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#index as JSON Parameters: {"user"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder PushType::User Load (0.2ms) SELECT "push_type_users".* FROM "push_type_users" ORDER BY "push_type_users"."name" ASC LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.7ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder (5.4ms) Completed 200 OK in 9ms (Views: 5.6ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::UsersControllerTest::GET #index: test_0004_anonymous -------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.3ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-11@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-11@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-12@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-12@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-13@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-13@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-14@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-14@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-15@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-15@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#index as JSON Parameters: {"user"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder PushType::User Load (0.2ms) SELECT "push_type_users".* FROM "push_type_users" ORDER BY "push_type_users"."name" ASC LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder (3.3ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::UsersControllerTest::GET #index: test_0001_anonymous -------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-16@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-16@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.3ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-17@example.com"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-17@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-18@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-18@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-19@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-19@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-20@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-20@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#index as JSON Parameters: {"user"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder PushType::User Load (0.3ms) SELECT "push_type_users".* FROM "push_type_users" ORDER BY "push_type_users"."name" ASC LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder (3.0ms) Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.3ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::UsersControllerTest::GET #index: test_0002_anonymous -------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-21@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-21@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-22@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-22@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-23@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-23@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-24@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-24@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-25@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-25@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#index as JSON Parameters: {"user"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" ORDER BY "push_type_users"."name" ASC LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.4ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/index.json.jbuilder (2.7ms) Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #trash: test_0002_anonymous -------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-6"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-6"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t3e59f2f878b1286c999231e5c293df90 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "589de4d7-f904-4a54-8e2a-ae894f5cc281"], ["descendant_id", "589de4d7-f904-4a54-8e2a-ae894f5cc281"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "589de4d7-f904-4a54-8e2a-ae894f5cc281"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "589de4d7-f904-4a54-8e2a-ae894f5cc281"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "589de4d7-f904-4a54-8e2a-ae894f5cc281"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t39260cd565f39b8edd6719dc62b003cf  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-7"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-7"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS td958835e12f9cab5dba4d6390d4ea215 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "654aa3cc-aa8c-483f-b193-3b3f5d159d70"], ["descendant_id", "654aa3cc-aa8c-483f-b193-3b3f5d159d70"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "654aa3cc-aa8c-483f-b193-3b3f5d159d70"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "654aa3cc-aa8c-483f-b193-3b3f5d159d70"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "654aa3cc-aa8c-483f-b193-3b3f5d159d70"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t77858482eb26f00cf7d2d7879d36b083  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-8"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-8"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t1c8fe62627df985f692f9a3d4a2cfc98 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "69738b2d-2b28-4054-a63f-f1ddcf2534f5"], ["descendant_id", "69738b2d-2b28-4054-a63f-f1ddcf2534f5"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "69738b2d-2b28-4054-a63f-f1ddcf2534f5"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "69738b2d-2b28-4054-a63f-f1ddcf2534f5"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "69738b2d-2b28-4054-a63f-f1ddcf2534f5"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t9c38138801363252a1fcf269bac72e71  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-9"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-9"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t3ee64219f3c229ad6f77ec8c4ca0f589 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "678b4758-4ff0-4a0d-90c7-b19dc721b514"], ["descendant_id", "678b4758-4ff0-4a0d-90c7-b19dc721b514"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "678b4758-4ff0-4a0d-90c7-b19dc721b514"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "678b4758-4ff0-4a0d-90c7-b19dc721b514"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "678b4758-4ff0-4a0d-90c7-b19dc721b514"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t819c81fc30408ccd5b49d8a824aa64e7  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-10"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-10"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t54ecbe30e8b0ec9e30bfbefae7330895 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "9c252a8e-90ac-49f9-9895-e35e5048d58e"], ["descendant_id", "9c252a8e-90ac-49f9-9895-e35e5048d58e"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "9c252a8e-90ac-49f9-9895-e35e5048d58e"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "9c252a8e-90ac-49f9-9895-e35e5048d58e"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "9c252a8e-90ac-49f9-9895-e35e5048d58e"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb78ad9256a8c92934f16287df16dbea6  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#trash as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_nodes"."deleted_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "9c252a8e-90ac-49f9-9895-e35e5048d58e"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "9c252a8e-90ac-49f9-9895-e35e5048d58e"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "678b4758-4ff0-4a0d-90c7-b19dc721b514"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "678b4758-4ff0-4a0d-90c7-b19dc721b514"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "69738b2d-2b28-4054-a63f-f1ddcf2534f5"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "69738b2d-2b28-4054-a63f-f1ddcf2534f5"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [3 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (12.6ms) Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 1.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #trash: test_0001_anonymous -------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-11"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-11"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t82f97a1f436dbc10e9c3b4fc37d08404 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "bf5773e2-00f5-4029-ba98-090d3f829298"], ["descendant_id", "bf5773e2-00f5-4029-ba98-090d3f829298"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "bf5773e2-00f5-4029-ba98-090d3f829298"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "bf5773e2-00f5-4029-ba98-090d3f829298"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "bf5773e2-00f5-4029-ba98-090d3f829298"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS ta3f44e7a5af17fbeb444e02d3d2b2814  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-12"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-12"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t567df756e1b0ea5d6064cd53f7a3ae1f SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "190790e5-0d3e-4d69-89cc-bd244d0beb59"], ["descendant_id", "190790e5-0d3e-4d69-89cc-bd244d0beb59"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "190790e5-0d3e-4d69-89cc-bd244d0beb59"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "190790e5-0d3e-4d69-89cc-bd244d0beb59"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "190790e5-0d3e-4d69-89cc-bd244d0beb59"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS td46881017ea0f9afccbe8ffd9510c3c5  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-13"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-13"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tb8f5cef077127bff24b15602c416477b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "e2238399-a31b-44af-8c64-6e6bb9a79661"], ["descendant_id", "e2238399-a31b-44af-8c64-6e6bb9a79661"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "e2238399-a31b-44af-8c64-6e6bb9a79661"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "e2238399-a31b-44af-8c64-6e6bb9a79661"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "e2238399-a31b-44af-8c64-6e6bb9a79661"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tc2e25c9ba2891f13f9fe08f9f657bda5  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-14"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-14"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4f95e058335f19370a6b689622bb3471 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "830c7819-dfa3-413b-80f1-d9299532e45b"], ["descendant_id", "830c7819-dfa3-413b-80f1-d9299532e45b"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "830c7819-dfa3-413b-80f1-d9299532e45b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "830c7819-dfa3-413b-80f1-d9299532e45b"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "830c7819-dfa3-413b-80f1-d9299532e45b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t10df7f5f13d1a9b91ef4ea04b3e5d8cf  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-15"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-15"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS te8bc0a2ade09ae27139ed0e83fc6ba02 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "a0078bf4-302d-45a3-bf1b-4ba540faf3f0"], ["descendant_id", "a0078bf4-302d-45a3-bf1b-4ba540faf3f0"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a0078bf4-302d-45a3-bf1b-4ba540faf3f0"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "a0078bf4-302d-45a3-bf1b-4ba540faf3f0"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "a0078bf4-302d-45a3-bf1b-4ba540faf3f0"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb8702803a3c891890c2b0bd89801a59d  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#trash as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_nodes"."deleted_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "a0078bf4-302d-45a3-bf1b-4ba540faf3f0"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "a0078bf4-302d-45a3-bf1b-4ba540faf3f0"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "830c7819-dfa3-413b-80f1-d9299532e45b"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "830c7819-dfa3-413b-80f1-d9299532e45b"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "e2238399-a31b-44af-8c64-6e6bb9a79661"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "e2238399-a31b-44af-8c64-6e6bb9a79661"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [3 times] (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (12.4ms) Completed 200 OK in 13ms (Views: 11.3ms | ActiveRecord: 1.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #trash: test_0003_anonymous -------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-16"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-16"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS td5273d54187aa1dda772438c1d4af5bd SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d067ca77-252c-429e-82b7-2ea4300f83e6"], ["descendant_id", "d067ca77-252c-429e-82b7-2ea4300f83e6"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d067ca77-252c-429e-82b7-2ea4300f83e6"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d067ca77-252c-429e-82b7-2ea4300f83e6"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d067ca77-252c-429e-82b7-2ea4300f83e6"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t688f18102e9c546702b165bde4a9dfad  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-17"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-17"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t50f891e069d4ea69fe55a9e36bb0db69 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "41526a0f-f069-47f9-9fc1-ba09920c302f"], ["descendant_id", "41526a0f-f069-47f9-9fc1-ba09920c302f"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "41526a0f-f069-47f9-9fc1-ba09920c302f"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "41526a0f-f069-47f9-9fc1-ba09920c302f"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "41526a0f-f069-47f9-9fc1-ba09920c302f"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t5bff9a6ab8ea7cf826d00a82853b459f  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-18"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-18"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t64dbbe3906ed590bb7e03fcb8ed96c1a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "f87ba285-1536-47c7-bca0-3bf72b226c54"], ["descendant_id", "f87ba285-1536-47c7-bca0-3bf72b226c54"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "f87ba285-1536-47c7-bca0-3bf72b226c54"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "f87ba285-1536-47c7-bca0-3bf72b226c54"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "f87ba285-1536-47c7-bca0-3bf72b226c54"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tab76bf4b6bf2985305891f1f3483d48e  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-19"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-19"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t7ccd8f62036bba2105f45c3f1f00ba41 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "62bf1d23-bb7e-4af1-b23e-41e2d01153c9"], ["descendant_id", "62bf1d23-bb7e-4af1-b23e-41e2d01153c9"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "62bf1d23-bb7e-4af1-b23e-41e2d01153c9"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "62bf1d23-bb7e-4af1-b23e-41e2d01153c9"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "62bf1d23-bb7e-4af1-b23e-41e2d01153c9"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tae5a3b635b149881d2ee0f66b75d2b25  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-20"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-20"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t9b1d37a2ec2fd7938f8017c2911b673f SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7b281b9b-fe6b-4390-b6d3-f4c3bb572a80"], ["descendant_id", "7b281b9b-fe6b-4390-b6d3-f4c3bb572a80"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7b281b9b-fe6b-4390-b6d3-f4c3bb572a80"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7b281b9b-fe6b-4390-b6d3-f4c3bb572a80"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7b281b9b-fe6b-4390-b6d3-f4c3bb572a80"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t3d81b626bfc365726d9e55cfbf6dcc14  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#trash as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_nodes"."deleted_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "7b281b9b-fe6b-4390-b6d3-f4c3bb572a80"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "7b281b9b-fe6b-4390-b6d3-f4c3bb572a80"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "62bf1d23-bb7e-4af1-b23e-41e2d01153c9"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "62bf1d23-bb7e-4af1-b23e-41e2d01153c9"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.4ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "f87ba285-1536-47c7-bca0-3bf72b226c54"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "f87ba285-1536-47c7-bca0-3bf72b226c54"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [3 times] (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (12.0ms) Completed 200 OK in 13ms (Views: 11.0ms | ActiveRecord: 1.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::POST #create::with valid user: test_0001_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::UsersController#create as JSON Parameters: {"user"=>{"name"=>"Joe Bloggs", "email"=>"joe-26@example.com"}}  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-26@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-26@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.4ms) Completed 201 Created in 3ms (Views: 0.9ms | ActiveRecord: 0.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::POST #create::with valid user: test_0002_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::UsersController#create as JSON Parameters: {"user"=>{"name"=>"Joe Bloggs", "email"=>"joe-27@example.com"}}  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-27@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-27@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.4ms) Completed 201 Created in 3ms (Views: 0.8ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::UsersControllerTest::POST #create::with valid user: test_0003_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::UsersController#create as JSON Parameters: {"user"=>{"name"=>"Joe Bloggs", "email"=>"joe-28@example.com"}}  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-28@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-28@example.com"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.4ms) Completed 201 Created in 3ms (Views: 0.8ms | ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "push_type_users"  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #position::prepend node: test_0001_anonymous -------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-21"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-21"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2ffb38b25086797715f7916d34fd2f04 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["descendant_id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "05fc9567-65bd-491a-ab27-8728f813422e"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t7d341c75e26589f8ab980d7f4f99a4cb  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-22"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-22"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5141ae663316ac613b41fbc870838f5d SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "221375e4-6103-4dc3-95e3-4499f5796e53"], ["descendant_id", "221375e4-6103-4dc3-95e3-4499f5796e53"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "221375e4-6103-4dc3-95e3-4499f5796e53"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "221375e4-6103-4dc3-95e3-4499f5796e53"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "221375e4-6103-4dc3-95e3-4499f5796e53"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t89b4dee077845558a09d21ed0a16d1c2  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.4ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-23"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-23"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t14fc31dafac23003eebb1937237c203e SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7ecf5a42-5017-4c0e-ab66-7d9e95602b54"], ["descendant_id", "7ecf5a42-5017-4c0e-ab66-7d9e95602b54"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ecf5a42-5017-4c0e-ab66-7d9e95602b54"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7ecf5a42-5017-4c0e-ab66-7d9e95602b54"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7ecf5a42-5017-4c0e-ab66-7d9e95602b54"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS tcc5757000146626ab405c5e8600ab7ca  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-24"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-24"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t192df06f6787fe1c6a4fe6d44cb53847 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "83d2008e-c64d-4926-bb22-599d60590ffa"], ["descendant_id", "83d2008e-c64d-4926-bb22-599d60590ffa"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "83d2008e-c64d-4926-bb22-599d60590ffa"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "83d2008e-c64d-4926-bb22-599d60590ffa"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "83d2008e-c64d-4926-bb22-599d60590ffa"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0840ea3cb35002fd979ef97910ca5505  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-25"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-25"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t97babf4af0e0a1dc08190ce8be2a3ca8 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"], ["descendant_id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t147db6cf24718dd22b8f89d38c94ec2d  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#position as JSON Parameters: {"next"=>"05fc9567-65bd-491a-ab27-8728f813422e", "id"=>"d5319a76-5de5-45db-948b-1e2ce4a5a130", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-21"], ["id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS te154c8addc2a1230f6218f8cd94572d2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-25"], ["id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["sort_order", 0], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"]]  (0.5ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL AND "push_type_nodes"."sort_order" >= 0 ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "05fc9567-65bd-491a-ab27-8728f813422e"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = 1 WHERE "push_type_nodes"."id" = $1 [["id", "05fc9567-65bd-491a-ab27-8728f813422e"]] SQL (0.1ms) UPDATE "push_type_nodes" SET "sort_order" = 0 WHERE "push_type_nodes"."id" = $1 [["id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t4e43258eea27ebe272de78054b9f5212 Completed 204 No Content in 10ms (ActiveRecord: 2.2ms) Processing by PushType::Api::NodesController#index as JSON Parameters: {"next"=>"05fc9567-65bd-491a-ab27-8728f813422e", "node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "d5319a76-5de5-45db-948b-1e2ce4a5a130"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "05fc9567-65bd-491a-ab27-8728f813422e"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "05fc9567-65bd-491a-ab27-8728f813422e"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "221375e4-6103-4dc3-95e3-4499f5796e53"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "221375e4-6103-4dc3-95e3-4499f5796e53"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "7ecf5a42-5017-4c0e-ab66-7d9e95602b54"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "7ecf5a42-5017-4c0e-ab66-7d9e95602b54"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.2ms) PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "83d2008e-c64d-4926-bb22-599d60590ffa"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "83d2008e-c64d-4926-bb22-599d60590ffa"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.1ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (19.1ms) Completed 200 OK in 20ms (Views: 17.1ms | ActiveRecord: 2.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #position::prepend node: test_0002_anonymous -------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-26"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-26"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tacac828878c6b176c14f0596d69e0e7e SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["descendant_id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["LIMIT", 1000]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS te0b5aca0c8bcb0ae3a5b73cd5059ea9d  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-27"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-27"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tedaa2c8de44c75c4e197152c92f70c8f SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "756b7951-385d-40b2-9b1d-5504a3291149"], ["descendant_id", "756b7951-385d-40b2-9b1d-5504a3291149"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "756b7951-385d-40b2-9b1d-5504a3291149"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "756b7951-385d-40b2-9b1d-5504a3291149"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "756b7951-385d-40b2-9b1d-5504a3291149"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t69291900428a27b3ba8caace4a92e814  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-28"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-28"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tf147ac526ddcdd2f6398655d287eac88 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "71ccc034-3553-4dc3-9fdb-4ba84f003b82"], ["descendant_id", "71ccc034-3553-4dc3-9fdb-4ba84f003b82"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "71ccc034-3553-4dc3-9fdb-4ba84f003b82"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "71ccc034-3553-4dc3-9fdb-4ba84f003b82"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "71ccc034-3553-4dc3-9fdb-4ba84f003b82"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8e4bf6b165d7e7c7a0bae72d0cd46d24  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-29"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-29"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tebdbf597e231d77e1a5f0491c8aad9b5 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7aab4ac6-9b6b-4cd9-ac22-8b27efef7e8c"], ["descendant_id", "7aab4ac6-9b6b-4cd9-ac22-8b27efef7e8c"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7aab4ac6-9b6b-4cd9-ac22-8b27efef7e8c"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7aab4ac6-9b6b-4cd9-ac22-8b27efef7e8c"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7aab4ac6-9b6b-4cd9-ac22-8b27efef7e8c"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS ta29e580f04d5fa14977f2d382e394f79  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-30"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-30"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t9e97043bec091ea840271ce406bbf771 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "79181203-8257-476a-8bc4-6173a9bfcb1d"], ["descendant_id", "79181203-8257-476a-8bc4-6173a9bfcb1d"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "79181203-8257-476a-8bc4-6173a9bfcb1d"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "79181203-8257-476a-8bc4-6173a9bfcb1d"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "79181203-8257-476a-8bc4-6173a9bfcb1d"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tcf1a71058ed2530ed58499ffd6f93007  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#position as JSON Parameters: {"next"=>"3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0", "id"=>"79181203-8257-476a-8bc4-6173a9bfcb1d", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "79181203-8257-476a-8bc4-6173a9bfcb1d"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-26"], ["id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8cd280b70e09c2ae6be9044e8776ddb4  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-30"], ["id", "79181203-8257-476a-8bc4-6173a9bfcb1d"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["sort_order", 0], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "79181203-8257-476a-8bc4-6173a9bfcb1d"]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL AND "push_type_nodes"."sort_order" >= 0 ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "79181203-8257-476a-8bc4-6173a9bfcb1d"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = 1 WHERE "push_type_nodes"."id" = $1 [["id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = 0 WHERE "push_type_nodes"."id" = $1 [["id", "79181203-8257-476a-8bc4-6173a9bfcb1d"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t96ad0ab498a411646eb27d630a58ec45 Completed 204 No Content in 9ms (ActiveRecord: 2.2ms) Processing by PushType::Api::NodesController#index as JSON Parameters: {"next"=>"3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0", "node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "79181203-8257-476a-8bc4-6173a9bfcb1d"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "79181203-8257-476a-8bc4-6173a9bfcb1d"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.8ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "3e532ef4-f5bb-47bb-9b90-1c9e62a6d9f0"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "756b7951-385d-40b2-9b1d-5504a3291149"]]  (0.3ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "756b7951-385d-40b2-9b1d-5504a3291149"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (7.5ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "71ccc034-3553-4dc3-9fdb-4ba84f003b82"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "71ccc034-3553-4dc3-9fdb-4ba84f003b82"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "7aab4ac6-9b6b-4cd9-ac22-8b27efef7e8c"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "7aab4ac6-9b6b-4cd9-ac22-8b27efef7e8c"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.4ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (24.9ms) Completed 200 OK in 26ms (Views: 22.8ms | ActiveRecord: 2.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #destroy::with untrashed asset: test_0004_anonymous -----------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "4"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#destroy as JSON Parameters: {"id"=>"849841e6-c461-450b-a7cc-73fdf17112f2", "asset"=>{}} PushType::Asset Load (0.3ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "849841e6-c461-450b-a7cc-73fdf17112f2"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "849841e6-c461-450b-a7cc-73fdf17112f2"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.6ms) Completed 200 OK in 4ms (Views: 1.1ms | ActiveRecord: 0.8ms) PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 LIMIT $2 [["id", "849841e6-c461-450b-a7cc-73fdf17112f2"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #destroy::with untrashed asset: test_0002_anonymous -----------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "5"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#destroy as JSON Parameters: {"id"=>"1f072638-47ab-4e0a-8611-40361a3fe4b3", "asset"=>{}} PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "1f072638-47ab-4e0a-8611-40361a3fe4b3"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "1f072638-47ab-4e0a-8611-40361a3fe4b3"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.8ms) Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.7ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #destroy::with untrashed asset: test_0001_anonymous -----------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "6"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#destroy as JSON Parameters: {"id"=>"4911b508-3158-4c60-865c-b931626c0eae", "asset"=>{}} PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "4911b508-3158-4c60-865c-b931626c0eae"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "4911b508-3158-4c60-865c-b931626c0eae"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.7ms) Completed 200 OK in 4ms (Views: 1.2ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #destroy::with untrashed asset: test_0003_anonymous -----------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 SQL (0.5ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "7"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#destroy as JSON Parameters: {"id"=>"8546732f-9977-4f8d-acbe-879370d0678c", "asset"=>{}} PushType::Asset Load (5.8ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "8546732f-9977-4f8d-acbe-879370d0678c"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_2 SQL (0.3ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "8546732f-9977-4f8d-acbe-879370d0678c"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.8ms) Completed 200 OK in 13ms (Views: 1.3ms | ActiveRecord: 6.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #update::with in-valid node: test_0001_anonymous ----------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-31"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-31"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2d47a29cf05ccd0f47777ba8ffc7fbb1 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"], ["descendant_id", "4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"], ["generations", 0]]  (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t2833cd1b388f6d39e9659231e7730dea  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#update as JSON Parameters: {"node"=>{"title"=>""}, "id"=>"4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-31"], ["id", "4f5fa106-1db1-462d-b5cc-fc83f8c7dc22"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 5ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #update::with in-valid node: test_0002_anonymous ----------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-32"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-32"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tc452788db800e8540fb51f3efea05a2b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "ca4dc5f1-8fdc-4c13-a108-792391193f5e"], ["descendant_id", "ca4dc5f1-8fdc-4c13-a108-792391193f5e"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ca4dc5f1-8fdc-4c13-a108-792391193f5e"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "ca4dc5f1-8fdc-4c13-a108-792391193f5e"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "ca4dc5f1-8fdc-4c13-a108-792391193f5e"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0956a020e7ad3239fbc4719acff6eeaa  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#update as JSON Parameters: {"node"=>{"title"=>""}, "id"=>"ca4dc5f1-8fdc-4c13-a108-792391193f5e"} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ca4dc5f1-8fdc-4c13-a108-792391193f5e"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-32"], ["id", "ca4dc5f1-8fdc-4c13-a108-792391193f5e"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #empty: test_0001_anonymous -----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.4ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "8"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "9"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "10"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#empty as JSON Parameters: {"asset"=>{}} PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_assets"."created_at" DESC  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "09194f45-ce02-413b-a59e-d5a79131442e"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 SQL (0.1ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "8d37d775-ddd3-468b-af94-8ff260e50804"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 SQL (0.1ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "14c307f9-3cb2-442b-80f6-fb9cee090ce6"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #empty: test_0003_anonymous -----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "11"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "12"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "13"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#empty as JSON Parameters: {"asset"=>{}} PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_assets"."created_at" DESC  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "94ea1bff-f7a0-4472-a228-397f95c2c578"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 SQL (0.1ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "25797085-b213-4364-b609-7febd8c53061"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "42766f63-71b0-49a2-823f-c90f1a0966b1"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 4ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "push_type_assets" WHERE (deleted_at IS NOT NULL)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #empty: test_0002_anonymous -----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "14"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.4ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "15"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.4ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "16"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#empty as JSON Parameters: {"asset"=>{}} PushType::Asset Load (0.7ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_assets"."created_at" DESC  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "c0608773-46b4-49b3-a29f-7ffe334f9f72"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "b4e70764-1689-40c6-862d-d174c419b5be"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "82240d22-b7d5-477b-ade9-d13b28f9d9a0"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 5ms (ActiveRecord: 2.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------ PushType::Api::NodesControllerTest::POST #position::append node: test_0002_anonymous ------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-33"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-33"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4e9d7f12f9071d78556fd74fab6ddcc5 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["descendant_id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "850056ca-571a-4e32-8304-8e4112be8ee8"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tc727aec88ad52832d71a6f5f580c6d72  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-34"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-34"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8016fe628b1aadef33eb03e08c40c258 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "b952ca77-bfe9-477f-9671-47e381817959"], ["descendant_id", "b952ca77-bfe9-477f-9671-47e381817959"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b952ca77-bfe9-477f-9671-47e381817959"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "b952ca77-bfe9-477f-9671-47e381817959"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "b952ca77-bfe9-477f-9671-47e381817959"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t38c2862a012c4dff17096df23770d279  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-35"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-35"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t7d777c4a37b8a71c5d5fcd98f31328b4 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "6f362d96-3724-4083-a80c-b5b8b8b9def6"], ["descendant_id", "6f362d96-3724-4083-a80c-b5b8b8b9def6"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "6f362d96-3724-4083-a80c-b5b8b8b9def6"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "6f362d96-3724-4083-a80c-b5b8b8b9def6"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "6f362d96-3724-4083-a80c-b5b8b8b9def6"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t1b482c051e0252a90f129543790c17c4  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-36"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-36"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta2a021932fdc263fb968991e8cd94d76 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "fee0dc2f-e99c-4edb-bf0b-b3524702c116"], ["descendant_id", "fee0dc2f-e99c-4edb-bf0b-b3524702c116"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fee0dc2f-e99c-4edb-bf0b-b3524702c116"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "fee0dc2f-e99c-4edb-bf0b-b3524702c116"], ["LIMIT", 1000]] PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "fee0dc2f-e99c-4edb-bf0b-b3524702c116"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS ta6353a439326c2a54bd99283c1bcb21b  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-37"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-37"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tce87e8872a061920a6db4521437b0244 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "980888fb-37c1-487a-83e7-2039c322fe55"], ["descendant_id", "980888fb-37c1-487a-83e7-2039c322fe55"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "980888fb-37c1-487a-83e7-2039c322fe55"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "980888fb-37c1-487a-83e7-2039c322fe55"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "980888fb-37c1-487a-83e7-2039c322fe55"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t08e28d3b06b5095f8963b2490a20ae96  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#position as JSON Parameters: {"prev"=>"850056ca-571a-4e32-8304-8e4112be8ee8", "id"=>"980888fb-37c1-487a-83e7-2039c322fe55", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "980888fb-37c1-487a-83e7-2039c322fe55"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-33"], ["id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t6870c2f8815c0ae7b568194d19371c77  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-37"], ["id", "980888fb-37c1-487a-83e7-2039c322fe55"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["sort_order", 0], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "980888fb-37c1-487a-83e7-2039c322fe55"]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL AND "push_type_nodes"."sort_order" >= 0 ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "850056ca-571a-4e32-8304-8e4112be8ee8"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "980888fb-37c1-487a-83e7-2039c322fe55"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS td289798bae1bfd266683ef6537d00f50 Completed 204 No Content in 9ms (ActiveRecord: 1.7ms) Processing by PushType::Api::NodesController#index as JSON Parameters: {"prev"=>"850056ca-571a-4e32-8304-8e4112be8ee8", "node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "850056ca-571a-4e32-8304-8e4112be8ee8"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "850056ca-571a-4e32-8304-8e4112be8ee8"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "980888fb-37c1-487a-83e7-2039c322fe55"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "980888fb-37c1-487a-83e7-2039c322fe55"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.4ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "b952ca77-bfe9-477f-9671-47e381817959"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "b952ca77-bfe9-477f-9671-47e381817959"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.4ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "6f362d96-3724-4083-a80c-b5b8b8b9def6"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "6f362d96-3724-4083-a80c-b5b8b8b9def6"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.2ms) PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "fee0dc2f-e99c-4edb-bf0b-b3524702c116"]]  (0.3ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "fee0dc2f-e99c-4edb-bf0b-b3524702c116"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (19.9ms) Completed 200 OK in 21ms (Views: 17.9ms | ActiveRecord: 2.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------ PushType::Api::NodesControllerTest::POST #position::append node: test_0001_anonymous ------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-38"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-38"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t804d8adf8c6eff73f4da05d9f76dfb8a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["descendant_id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "af22978f-9c2a-4cc8-b651-d8248385c8af"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS taa08472882f8f168b5103ac0a0c5b70f  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-39"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-39"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t74eb5b50bb8b218e268e2f0efbd8b273 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "8679d5f1-cfbe-478b-8a1b-b496a8088ddf"], ["descendant_id", "8679d5f1-cfbe-478b-8a1b-b496a8088ddf"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "8679d5f1-cfbe-478b-8a1b-b496a8088ddf"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "8679d5f1-cfbe-478b-8a1b-b496a8088ddf"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "8679d5f1-cfbe-478b-8a1b-b496a8088ddf"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t387565ad130843ab9513d60dc8e82a79  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-40"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-40"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tb609ba75dbdf01728fcd34c474193bdb SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "6985083a-ba7f-4583-a4f0-a84844c61c6c"], ["descendant_id", "6985083a-ba7f-4583-a4f0-a84844c61c6c"], ["generations", 0]]  (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "6985083a-ba7f-4583-a4f0-a84844c61c6c"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "6985083a-ba7f-4583-a4f0-a84844c61c6c"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "6985083a-ba7f-4583-a4f0-a84844c61c6c"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tef89d57cac81923ba430ba9948ed70f0  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-41"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-41"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta43b633eb748cfec941372268e6fd61b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "43acb4ce-8df1-4e98-a774-cc3d17924e10"], ["descendant_id", "43acb4ce-8df1-4e98-a774-cc3d17924e10"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "43acb4ce-8df1-4e98-a774-cc3d17924e10"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "43acb4ce-8df1-4e98-a774-cc3d17924e10"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "43acb4ce-8df1-4e98-a774-cc3d17924e10"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t1abc8878a42cb72386a79ea711867301  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-42"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-42"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8942a0e0d3befc5b1f3e8b8d02452fde SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "c57e7be1-dcad-4829-bae6-13078b456389"], ["descendant_id", "c57e7be1-dcad-4829-bae6-13078b456389"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c57e7be1-dcad-4829-bae6-13078b456389"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "c57e7be1-dcad-4829-bae6-13078b456389"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "c57e7be1-dcad-4829-bae6-13078b456389"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS td814e507d731489d077272052c0d67d5  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#position as JSON Parameters: {"prev"=>"af22978f-9c2a-4cc8-b651-d8248385c8af", "id"=>"c57e7be1-dcad-4829-bae6-13078b456389", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c57e7be1-dcad-4829-bae6-13078b456389"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-38"], ["id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tc82e8bfe2e83890db3bfcc23658bff6c  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-42"], ["id", "c57e7be1-dcad-4829-bae6-13078b456389"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["sort_order", 0], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "c57e7be1-dcad-4829-bae6-13078b456389"]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL AND "push_type_nodes"."sort_order" >= 0 ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "af22978f-9c2a-4cc8-b651-d8248385c8af"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c57e7be1-dcad-4829-bae6-13078b456389"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t82c93c70410a239ad57f7a8de284aff7 Completed 204 No Content in 9ms (ActiveRecord: 1.8ms) Processing by PushType::Api::NodesController#index as JSON Parameters: {"prev"=>"af22978f-9c2a-4cc8-b651-d8248385c8af", "node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "af22978f-9c2a-4cc8-b651-d8248385c8af"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "af22978f-9c2a-4cc8-b651-d8248385c8af"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.8ms) PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "c57e7be1-dcad-4829-bae6-13078b456389"]]  (0.4ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "c57e7be1-dcad-4829-bae6-13078b456389"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.4ms) PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "8679d5f1-cfbe-478b-8a1b-b496a8088ddf"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "8679d5f1-cfbe-478b-8a1b-b496a8088ddf"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "6985083a-ba7f-4583-a4f0-a84844c61c6c"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "6985083a-ba7f-4583-a4f0-a84844c61c6c"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.1ms) PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "43acb4ce-8df1-4e98-a774-cc3d17924e10"]]  (0.3ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "43acb4ce-8df1-4e98-a774-cc3d17924e10"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (22.7ms) Completed 200 OK in 24ms (Views: 19.9ms | ActiveRecord: 3.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- PushType::ApiTest: test_0001_should have registered the admin engine --------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN -------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #index: test_0002_anonymous --------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "17"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "18"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "19"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "20"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "21"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#index as JSON Parameters: {"asset"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."deleted_at" IS NULL ORDER BY "push_type_assets"."created_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 12], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.4ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder (5.6ms) Completed 200 OK in 10ms (Views: 5.9ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #index: test_0003_anonymous --------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "22"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "23"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "24"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "25"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "26"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#index as JSON Parameters: {"asset"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."deleted_at" IS NULL ORDER BY "push_type_assets"."created_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 12], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.4ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder (5.0ms) Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #index: test_0001_anonymous --------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "27"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "28"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "29"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "30"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "31"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#index as JSON Parameters: {"asset"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."deleted_at" IS NULL ORDER BY "push_type_assets"."created_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 12], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder (4.4ms) Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #index: test_0004_anonymous --------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "32"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "33"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "34"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "35"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "36"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#index as JSON Parameters: {"asset"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."deleted_at" IS NULL ORDER BY "push_type_assets"."created_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 12], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder (4.5ms) Completed 200 OK in 6ms (Views: 4.9ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ---------------------------------------------------------------------- PushType::Api::AssetsControllerTest::PUT #restore: test_0001_anonymous ----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "37"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_assets"."id" = $3 [["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC], ["id", "8d3b998e-7f98-4a8b-b4e1-50813cc0e387"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#restore as JSON Parameters: {"id"=>"8d3b998e-7f98-4a8b-b4e1-50813cc0e387", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "8d3b998e-7f98-4a8b-b4e1-50813cc0e387"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "8d3b998e-7f98-4a8b-b4e1-50813cc0e387"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- PushType::Api::AssetsControllerTest::PUT #restore: test_0003_anonymous ----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "38"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_assets"."id" = $3 [["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC], ["id", "5f984fdf-1af0-4152-90ff-7baf7e0cab6c"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#restore as JSON Parameters: {"id"=>"5f984fdf-1af0-4152-90ff-7baf7e0cab6c", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "5f984fdf-1af0-4152-90ff-7baf7e0cab6c"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "5f984fdf-1af0-4152-90ff-7baf7e0cab6c"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- PushType::Api::AssetsControllerTest::PUT #restore: test_0004_anonymous ----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "39"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_assets"."id" = $3 [["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC], ["id", "aecdfd12-d2ea-4668-ba22-9e20a4f78632"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#restore as JSON Parameters: {"id"=>"aecdfd12-d2ea-4668-ba22-9e20a4f78632", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "aecdfd12-d2ea-4668-ba22-9e20a4f78632"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "aecdfd12-d2ea-4668-ba22-9e20a4f78632"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.4ms) PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 LIMIT $2 [["id", "aecdfd12-d2ea-4668-ba22-9e20a4f78632"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- PushType::Api::AssetsControllerTest::PUT #restore: test_0002_anonymous ----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "40"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) UPDATE "push_type_assets" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_assets"."id" = $3 [["updated_at", 2017-04-07 12:50:15 UTC], ["deleted_at", 2017-04-07 12:50:15 UTC], ["id", "fa375d3c-4ab2-4dd9-bbc6-a74edb70e3a7"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#restore as JSON Parameters: {"id"=>"fa375d3c-4ab2-4dd9-bbc6-a74edb70e3a7", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "fa375d3c-4ab2-4dd9-bbc6-a74edb70e3a7"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) UPDATE "push_type_assets" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_assets"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:15 UTC], ["id", "fa375d3c-4ab2-4dd9-bbc6-a74edb70e3a7"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #show: test_0001_anonymous -------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "41"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#show as JSON Parameters: {"id"=>"c159fc7a-6120-431c-9785-6da606d2f6d7", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "c159fc7a-6120-431c-9785-6da606d2f6d7"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.6ms) Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #show: test_0002_anonymous -------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "42"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#show as JSON Parameters: {"id"=>"05b4903b-b39f-4449-ba11-f67f05d219d5", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "05b4903b-b39f-4449-ba11-f67f05d219d5"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.7ms) Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #show: test_0003_anonymous -------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "43"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#show as JSON Parameters: {"id"=>"91cba3b0-d4f4-47b3-befd-885a042141fa", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "91cba3b0-d4f4-47b3-befd-885a042141fa"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.6ms) Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::NodesControllerTest::GET #show: test_0001_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-43"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-43"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t7392e48fc5f8cdd55e758a876f5d99d1 SQL (0.4ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"], ["descendant_id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"], ["generations", 0]]  (0.7ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t68b73edf0125e8d2b84f77f9f978a4a6  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#show as JSON Parameters: {"id"=>"1d07a3b6-a772-4647-97a5-a6dec209d4d8", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "1d07a3b6-a772-4647-97a5-a6dec209d4d8"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.0ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.6ms) Completed 200 OK in 6ms (Views: 4.6ms | ActiveRecord: 0.7ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::NodesControllerTest::GET #show: test_0006_anonymous ------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-44"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-44"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t60f2703a93d89d90f6483ebf2e2746d8 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "093c6e01-8acf-4000-9383-f9a7c5af3318"], ["descendant_id", "093c6e01-8acf-4000-9383-f9a7c5af3318"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "093c6e01-8acf-4000-9383-f9a7c5af3318"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "093c6e01-8acf-4000-9383-f9a7c5af3318"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "093c6e01-8acf-4000-9383-f9a7c5af3318"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS tfaad9a51f490639704aad75d2cd4d11a  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#show as JSON Parameters: {"id"=>"093c6e01-8acf-4000-9383-f9a7c5af3318", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "093c6e01-8acf-4000-9383-f9a7c5af3318"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "093c6e01-8acf-4000-9383-f9a7c5af3318"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "093c6e01-8acf-4000-9383-f9a7c5af3318"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.2ms) Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::NodesControllerTest::GET #show: test_0005_anonymous ------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-45"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-45"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t58539bd610c8e38d83dbeb26cb3e3ba9 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"], ["descendant_id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tfa112a011a3b7e1f5d528a0f266fd2ff  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#show as JSON Parameters: {"id"=>"15c54388-d15d-41ad-b1f0-940a6fc8fad3", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "15c54388-d15d-41ad-b1f0-940a6fc8fad3"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.0ms) Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::NodesControllerTest::GET #show: test_0004_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-46"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-46"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t451e6014c31ac5e383cebed10dbe6065 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"], ["descendant_id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tf794d8f72a0d110b4800bdb92d2c168e  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#show as JSON Parameters: {"id"=>"963a1ec7-c3cf-4b83-bd51-f8120e534777", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "963a1ec7-c3cf-4b83-bd51-f8120e534777"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.0ms) Completed 200 OK in 5ms (Views: 3.9ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::NodesControllerTest::GET #show: test_0002_anonymous ------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-47"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-47"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t0922954e32c45841b95d236f5e40e221 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "cb00e10e-36b3-4112-b201-2467cab4f44a"], ["descendant_id", "cb00e10e-36b3-4112-b201-2467cab4f44a"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "cb00e10e-36b3-4112-b201-2467cab4f44a"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "cb00e10e-36b3-4112-b201-2467cab4f44a"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "cb00e10e-36b3-4112-b201-2467cab4f44a"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t997ca193b6624e610c31531cd7582dea  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#show as JSON Parameters: {"id"=>"cb00e10e-36b3-4112-b201-2467cab4f44a", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "cb00e10e-36b3-4112-b201-2467cab4f44a"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "cb00e10e-36b3-4112-b201-2467cab4f44a"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "cb00e10e-36b3-4112-b201-2467cab4f44a"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.1ms) Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::NodesControllerTest::GET #show: test_0003_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-48"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-48"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tf001c6dc7df6d85e6ac7ea305ba96a31 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"], ["descendant_id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t9086d78e663578fa34a9ccb08023f93d  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#show as JSON Parameters: {"id"=>"0ca959cd-6740-4ee8-84d6-e5bd7a1182b3", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "0ca959cd-6740-4ee8-84d6-e5bd7a1182b3"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.2ms) Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::NodesControllerTest::GET #show: test_0007_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.4ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-49"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-49"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t94cf32d113bff57be6bb3eb95947a027 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"], ["descendant_id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"], ["generations", 0]]  (0.5ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t719b9a7cc525cf2d4df0c1763c820d99  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#show as JSON Parameters: {"id"=>"fd59afb4-6d61-4dc5-8f65-8c7552f94e9b", "node"=>{}} PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "fd59afb4-6d61-4dc5-8f65-8c7552f94e9b"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (3.8ms) Completed 200 OK in 5ms (Views: 3.7ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN --------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #restore: test_0004_anonymous ---------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-50"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-50"], ["status", 0], ["created_at", 2017-04-07 12:50:15 UTC], ["updated_at", 2017-04-07 12:50:15 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tfd8dee1a130be8d5162aa869cefb7c07 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "8848898a-74fc-4801-b41f-80ff1feadefe"], ["descendant_id", "8848898a-74fc-4801-b41f-80ff1feadefe"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "8848898a-74fc-4801-b41f-80ff1feadefe"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "8848898a-74fc-4801-b41f-80ff1feadefe"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "8848898a-74fc-4801-b41f-80ff1feadefe"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t06ea5abd9f30740e241e1fce1e1cc3b5  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_nodes"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "8848898a-74fc-4801-b41f-80ff1feadefe"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.5ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.009605' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '8848898a-74fc-4801-b41f-80ff1feadefe') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "8848898a-74fc-4801-b41f-80ff1feadefe"]] Processing by PushType::Api::NodesController#restore as JSON Parameters: {"id"=>"8848898a-74fc-4801-b41f-80ff1feadefe", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "8848898a-74fc-4801-b41f-80ff1feadefe"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "8848898a-74fc-4801-b41f-80ff1feadefe"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "8848898a-74fc-4801-b41f-80ff1feadefe"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "8848898a-74fc-4801-b41f-80ff1feadefe"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.8ms) Completed 200 OK in 9ms (Views: 4.7ms | ActiveRecord: 1.0ms) Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "8848898a-74fc-4801-b41f-80ff1feadefe"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #restore: test_0001_anonymous ---------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-51"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-51"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t612c4d90b5440d4957dc2ef5e5315b1d SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"], ["descendant_id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t3f220f4fafdc4cffb0153410118d6363  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_nodes"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.037020' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '33b5ffdd-6d7b-4df0-9cf1-d6229228a61b') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"]] Processing by PushType::Api::NodesController#restore as JSON Parameters: {"id"=>"33b5ffdd-6d7b-4df0-9cf1-d6229228a61b", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "33b5ffdd-6d7b-4df0-9cf1-d6229228a61b"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.5ms) Completed 200 OK in 9ms (Views: 4.5ms | ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #restore: test_0002_anonymous ---------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-52"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-52"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t52a55f36b960073c496d3aabd4fd4539 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"], ["descendant_id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te5db3f2d7f8cfde7072e398f31527e9f  (0.2ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_nodes"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.062865' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '85bdd523-9ab7-4574-a352-aabc64a3f21a') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"]] Processing by PushType::Api::NodesController#restore as JSON Parameters: {"id"=>"85bdd523-9ab7-4574-a352-aabc64a3f21a", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "85bdd523-9ab7-4574-a352-aabc64a3f21a"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (5.8ms) Completed 200 OK in 10ms (Views: 5.8ms | ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- PushType::Api::NodesControllerTest::PUT #restore: test_0003_anonymous ---------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-53"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-53"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2a8b0943b37128b52579cb0c799a415a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "bb7149c8-fb95-49a1-b528-4deea4a80964"], ["descendant_id", "bb7149c8-fb95-49a1-b528-4deea4a80964"], ["generations", 0]]  (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "bb7149c8-fb95-49a1-b528-4deea4a80964"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "bb7149c8-fb95-49a1-b528-4deea4a80964"], ["LIMIT", 1000]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "bb7149c8-fb95-49a1-b528-4deea4a80964"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t02f00361aa5f70ca9a2fa3d371869b94  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) UPDATE "push_type_nodes" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_nodes"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "bb7149c8-fb95-49a1-b528-4deea4a80964"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.091212' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != 'bb7149c8-fb95-49a1-b528-4deea4a80964') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "bb7149c8-fb95-49a1-b528-4deea4a80964"]] Processing by PushType::Api::NodesController#restore as JSON Parameters: {"id"=>"bb7149c8-fb95-49a1-b528-4deea4a80964", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "bb7149c8-fb95-49a1-b528-4deea4a80964"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", nil], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "bb7149c8-fb95-49a1-b528-4deea4a80964"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "bb7149c8-fb95-49a1-b528-4deea4a80964"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "bb7149c8-fb95-49a1-b528-4deea4a80964"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.4ms) Completed 200 OK in 9ms (Views: 4.4ms | ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #position::without reponsitioning: test_0002_anonymous -----------------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-54"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-54"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t99130b6bfa1ddc1e8d1f0127b99cc2f7 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "593c55e9-b6c5-41ff-af4d-74e6ca28a749"], ["descendant_id", "593c55e9-b6c5-41ff-af4d-74e6ca28a749"], ["generations", 0]]  (4.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "593c55e9-b6c5-41ff-af4d-74e6ca28a749"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "593c55e9-b6c5-41ff-af4d-74e6ca28a749"], ["LIMIT", 1000]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "593c55e9-b6c5-41ff-af4d-74e6ca28a749"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t93f294efb88207242733c25976b6434d  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-55"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-55"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8d7262d5291d1bef3500ec93cce9a998 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "19731d06-685b-452f-a601-94ba9114aab6"], ["descendant_id", "19731d06-685b-452f-a601-94ba9114aab6"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "19731d06-685b-452f-a601-94ba9114aab6"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "19731d06-685b-452f-a601-94ba9114aab6"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "19731d06-685b-452f-a601-94ba9114aab6"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t9587fe9b9cacc79aafc0fe076448529b  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-56"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-56"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8b756ae00a5851fae749f5236f8b0ac0 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "2525b4ee-1f23-40c6-bc5c-5d6057f2b80c"], ["descendant_id", "2525b4ee-1f23-40c6-bc5c-5d6057f2b80c"], ["generations", 0]]  (0.5ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "2525b4ee-1f23-40c6-bc5c-5d6057f2b80c"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "2525b4ee-1f23-40c6-bc5c-5d6057f2b80c"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "2525b4ee-1f23-40c6-bc5c-5d6057f2b80c"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t970cec789a22fd1bfd8bd87d12c8fc01  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-57"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-57"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4f44a79174a9cb33f3333f664ae5d5c7 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "f5830722-da24-4310-b73b-e861a13c7cbd"], ["descendant_id", "f5830722-da24-4310-b73b-e861a13c7cbd"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "f5830722-da24-4310-b73b-e861a13c7cbd"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "f5830722-da24-4310-b73b-e861a13c7cbd"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "f5830722-da24-4310-b73b-e861a13c7cbd"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t63fc7f92648c9ba5e94bfec5ab61a3e0  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-58"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-58"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8260a1f8342a2cc27bdc094000ffc004 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "339c24cc-9424-47e5-a760-eece5d972d7f"], ["descendant_id", "339c24cc-9424-47e5-a760-eece5d972d7f"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "339c24cc-9424-47e5-a760-eece5d972d7f"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "339c24cc-9424-47e5-a760-eece5d972d7f"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "339c24cc-9424-47e5-a760-eece5d972d7f"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tbd483709f81630c4cce895d53650f8db  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "593c55e9-b6c5-41ff-af4d-74e6ca28a749"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "593c55e9-b6c5-41ff-af4d-74e6ca28a749"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.5ms) PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "19731d06-685b-452f-a601-94ba9114aab6"]]  (0.3ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "19731d06-685b-452f-a601-94ba9114aab6"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.4ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "2525b4ee-1f23-40c6-bc5c-5d6057f2b80c"]]  (0.3ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "2525b4ee-1f23-40c6-bc5c-5d6057f2b80c"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.6ms) PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "f5830722-da24-4310-b73b-e861a13c7cbd"]]  (0.5ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "f5830722-da24-4310-b73b-e861a13c7cbd"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.0ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "339c24cc-9424-47e5-a760-eece5d972d7f"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "339c24cc-9424-47e5-a760-eece5d972d7f"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.4ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (27.6ms) Completed 200 OK in 29ms (Views: 24.3ms | ActiveRecord: 3.7ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #position::without reponsitioning: test_0001_anonymous -----------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-59"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-59"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4afe186be7c1eb9bb1ddacdc9096f771 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "c21b4fc4-767f-459a-9715-8c1fc7e3565d"], ["descendant_id", "c21b4fc4-767f-459a-9715-8c1fc7e3565d"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c21b4fc4-767f-459a-9715-8c1fc7e3565d"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "c21b4fc4-767f-459a-9715-8c1fc7e3565d"], ["LIMIT", 1000]] PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "c21b4fc4-767f-459a-9715-8c1fc7e3565d"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS te419f2042456a7fc85f9068acc38fa17  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-60"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-60"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS tbc71ebf6b347003f2a5111296dfc417b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "9ca89b70-e9ee-4412-aabe-e6fbb0e6b1ef"], ["descendant_id", "9ca89b70-e9ee-4412-aabe-e6fbb0e6b1ef"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "9ca89b70-e9ee-4412-aabe-e6fbb0e6b1ef"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "9ca89b70-e9ee-4412-aabe-e6fbb0e6b1ef"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "9ca89b70-e9ee-4412-aabe-e6fbb0e6b1ef"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tf36f51814e1d3329d9d45a013142e030  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-61"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-61"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tb8a7911e54e01d3eab2c74c8b99f8fb9 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "76e22c05-f5c3-4a5c-acfa-4416e612b091"], ["descendant_id", "76e22c05-f5c3-4a5c-acfa-4416e612b091"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "76e22c05-f5c3-4a5c-acfa-4416e612b091"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "76e22c05-f5c3-4a5c-acfa-4416e612b091"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "76e22c05-f5c3-4a5c-acfa-4416e612b091"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS ta58f777056f63f29bee40d421ae0bf39  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-62"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-62"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t125d89ab6523c4f1dad3b0ba65bc3672 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "a5d04808-76f1-4906-8bd4-c5dbfb820dd1"], ["descendant_id", "a5d04808-76f1-4906-8bd4-c5dbfb820dd1"], ["generations", 0]]  (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a5d04808-76f1-4906-8bd4-c5dbfb820dd1"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "a5d04808-76f1-4906-8bd4-c5dbfb820dd1"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "a5d04808-76f1-4906-8bd4-c5dbfb820dd1"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tbf5d68a83fd840f70eccb3ebdfb42673  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-63"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-63"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tb4097af701b3acd7221ce7ce248330a1 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "75747f79-a8bc-47fd-9fd8-5a1ad308fddd"], ["descendant_id", "75747f79-a8bc-47fd-9fd8-5a1ad308fddd"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "75747f79-a8bc-47fd-9fd8-5a1ad308fddd"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "75747f79-a8bc-47fd-9fd8-5a1ad308fddd"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "75747f79-a8bc-47fd-9fd8-5a1ad308fddd"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb99cb9adb646c98b344dffe3e9f25a4b  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "c21b4fc4-767f-459a-9715-8c1fc7e3565d"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "c21b4fc4-767f-459a-9715-8c1fc7e3565d"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.0ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "9ca89b70-e9ee-4412-aabe-e6fbb0e6b1ef"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "9ca89b70-e9ee-4412-aabe-e6fbb0e6b1ef"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "76e22c05-f5c3-4a5c-acfa-4416e612b091"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "76e22c05-f5c3-4a5c-acfa-4416e612b091"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.2ms) PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "a5d04808-76f1-4906-8bd4-c5dbfb820dd1"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "a5d04808-76f1-4906-8bd4-c5dbfb820dd1"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "75747f79-a8bc-47fd-9fd8-5a1ad308fddd"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "75747f79-a8bc-47fd-9fd8-5a1ad308fddd"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (20.2ms) Completed 200 OK in 21ms (Views: 18.0ms | ActiveRecord: 2.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #create::with parent_scope: test_0001_anonymous ----------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-64"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-64"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t3f3f427c8adb5d7845890a057d2bce9b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"], ["descendant_id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tfdedd652ce9d535b64f8824e06482c95  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') Processing by PushType::Api::NodesController#create as JSON Parameters: {"node"=>{"title"=>"Foo bar", "slug"=>"foo-bar-65", "type"=>"Page", "parent_id"=>"b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"}}  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"], ["LIMIT", 1]] PushType::Node Exists (0.4ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-65"], ["parent_id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-65"], ["parent_id", "b8ef4f27-3e6b-4a30-b7a4-71879bbfa629"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t3fd95792109b2dedf40f9b603fe7652a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "ff6a622a-2fde-4e3f-9319-f1383da1530b"], ["descendant_id", "ff6a622a-2fde-4e3f-9319-f1383da1530b"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'ff6a622a-2fde-4e3f-9319-f1383da1530b', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'b8ef4f27-3e6b-4a30-b7a4-71879bbfa629'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'b8ef4f27-3e6b-4a30-b7a4-71879bbfa629' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ff6a622a-2fde-4e3f-9319-f1383da1530b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "ff6a622a-2fde-4e3f-9319-f1383da1530b"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "ff6a622a-2fde-4e3f-9319-f1383da1530b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8ed479e5944fdb72cfc8a5bb8be69cdf  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "ff6a622a-2fde-4e3f-9319-f1383da1530b"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "ff6a622a-2fde-4e3f-9319-f1383da1530b"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.2ms) Completed 201 Created in 22ms (Views: 4.2ms | ActiveRecord: 3.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #destroy::with untrashed node: test_0004_anonymous ---------------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-66"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-66"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t66329ea930d16f7b1660ba0cf3a72d06 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "2422fc8d-b925-4578-a3f0-db981b8cf880"], ["descendant_id", "2422fc8d-b925-4578-a3f0-db981b8cf880"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "2422fc8d-b925-4578-a3f0-db981b8cf880"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "2422fc8d-b925-4578-a3f0-db981b8cf880"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "2422fc8d-b925-4578-a3f0-db981b8cf880"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t10b255381a0ca183281f24458ec26dc4  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#destroy as JSON Parameters: {"id"=>"2422fc8d-b925-4578-a3f0-db981b8cf880", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "2422fc8d-b925-4578-a3f0-db981b8cf880"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "2422fc8d-b925-4578-a3f0-db981b8cf880"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.322728' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '2422fc8d-b925-4578-a3f0-db981b8cf880') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "2422fc8d-b925-4578-a3f0-db981b8cf880"]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "2422fc8d-b925-4578-a3f0-db981b8cf880"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "2422fc8d-b925-4578-a3f0-db981b8cf880"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (3.8ms) Completed 200 OK in 10ms (Views: 3.9ms | ActiveRecord: 1.3ms) Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "2422fc8d-b925-4578-a3f0-db981b8cf880"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #destroy::with untrashed node: test_0003_anonymous ---------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-67"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-67"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t9b1576a76c8bbecccc1abfbcb8cc9674 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"], ["descendant_id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tcfdd9aca63d1bf4e4b8ddfa8d155c346  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#destroy as JSON Parameters: {"id"=>"470299ac-172c-4d19-aa57-5e5ad9891d9d", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.344427' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '470299ac-172c-4d19-aa57-5e5ad9891d9d') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "470299ac-172c-4d19-aa57-5e5ad9891d9d"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.8ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.2ms) Completed 200 OK in 10ms (Views: 4.1ms | ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #destroy::with untrashed node: test_0001_anonymous ---------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-68"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-68"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tfc318ff983fa62218c51490a17c0712e SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"], ["descendant_id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t844a8d29143ce3c59d83f8f68a423898  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#destroy as JSON Parameters: {"id"=>"17545a09-b5e8-4510-b6f4-8e696e1ed88f", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.367290' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '17545a09-b5e8-4510-b6f4-8e696e1ed88f') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "17545a09-b5e8-4510-b6f4-8e696e1ed88f"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.0ms) Completed 200 OK in 10ms (Views: 3.9ms | ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #destroy::with untrashed node: test_0002_anonymous ---------------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-69"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-69"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2801b6a46e7d7703c13d171f4cf6f39e SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"], ["descendant_id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t37226b7d715743a80925b726ec9ef394  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#destroy as JSON Parameters: {"id"=>"e075c29f-45fb-45e9-a1ee-a745c20e2e75", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) UPDATE "push_type_nodes" SET "deleted_at" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["deleted_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.390617' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != 'e075c29f-45fb-45e9-a1ee-a745c20e2e75') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "e075c29f-45fb-45e9-a1ee-a745c20e2e75"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.4ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (3.8ms) Completed 200 OK in 10ms (Views: 3.7ms | ActiveRecord: 1.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ PushType::Api::UsersControllerTest::DELETE #destroy: test_0002_anonymous ------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-29@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-29@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#destroy as JSON Parameters: {"id"=>"67bed212-90e2-4280-8c72-2af9a9e33abc", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "67bed212-90e2-4280-8c72-2af9a9e33abc"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) DELETE FROM "push_type_users" WHERE "push_type_users"."id" = $1 [["id", "67bed212-90e2-4280-8c72-2af9a9e33abc"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 2ms (ActiveRecord: 0.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ------------------------------------------------------------------------ PushType::Api::UsersControllerTest::DELETE #destroy: test_0003_anonymous ------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-30@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-30@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#destroy as JSON Parameters: {"id"=>"f8036d21-d694-4b79-95f8-4aecb8228c08", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "f8036d21-d694-4b79-95f8-4aecb8228c08"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) DELETE FROM "push_type_users" WHERE "push_type_users"."id" = $1 [["id", "f8036d21-d694-4b79-95f8-4aecb8228c08"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 2ms (ActiveRecord: 0.3ms) PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 LIMIT $2 [["id", "f8036d21-d694-4b79-95f8-4aecb8228c08"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ PushType::Api::UsersControllerTest::DELETE #destroy: test_0001_anonymous ------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-31@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-31@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#destroy as JSON Parameters: {"id"=>"a5c6aa29-183f-4f07-8308-d908ff7d255f", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "a5c6aa29-183f-4f07-8308-d908ff7d255f"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) DELETE FROM "push_type_users" WHERE "push_type_users"."id" = $1 [["id", "a5c6aa29-183f-4f07-8308-d908ff7d255f"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 1ms (ActiveRecord: 0.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN --------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #destroy::with trashed asset: test_0001_anonymous ---------------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "44"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_assets"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "3c234f4c-b4d5-4abf-a9ae-933c1464cf61"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#destroy as JSON Parameters: {"id"=>"3c234f4c-b4d5-4abf-a9ae-933c1464cf61", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "3c234f4c-b4d5-4abf-a9ae-933c1464cf61"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "3c234f4c-b4d5-4abf-a9ae-933c1464cf61"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 2ms (ActiveRecord: 0.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #destroy::with trashed asset: test_0003_anonymous ---------------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "45"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_assets"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "ccd54d3a-fbf1-43f1-bdc4-c691bea90cb5"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#destroy as JSON Parameters: {"id"=>"ccd54d3a-fbf1-43f1-bdc4-c691bea90cb5", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "ccd54d3a-fbf1-43f1-bdc4-c691bea90cb5"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "ccd54d3a-fbf1-43f1-bdc4-c691bea90cb5"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 2ms (ActiveRecord: 0.4ms) PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 LIMIT $2 [["id", "ccd54d3a-fbf1-43f1-bdc4-c691bea90cb5"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::DELETE #destroy::with trashed asset: test_0002_anonymous ---------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "46"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_assets" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_assets"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "43d882c1-1ad8-4b22-a860-5b4575183a2c"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#destroy as JSON Parameters: {"id"=>"43d882c1-1ad8-4b22-a860-5b4575183a2c", "asset"=>{}} PushType::Asset Load (0.1ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 ORDER BY "push_type_assets"."created_at" DESC LIMIT $2 [["id", "43d882c1-1ad8-4b22-a860-5b4575183a2c"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) DELETE FROM "push_type_assets" WHERE "push_type_assets"."id" = $1 [["id", "43d882c1-1ad8-4b22-a860-5b4575183a2c"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 2ms (ActiveRecord: 0.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN -------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #trash: test_0002_anonymous --------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "47"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "48"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.1ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "49"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "50"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "51"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#trash as JSON Parameters: {"asset"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_assets"."created_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 12], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [3 times] (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder (3.3ms) Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #trash: test_0003_anonymous --------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "52"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "53"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "54"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "55"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "56"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#trash as JSON Parameters: {"asset"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_assets"."created_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 12], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [3 times] (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder (3.2ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- PushType::Api::AssetsControllerTest::GET #trash: test_0001_anonymous --------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "57"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "58"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "59"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "60"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["file_uid", "61"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::AssetsController#trash as JSON Parameters: {"asset"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder PushType::Asset Load (0.2ms) SELECT "push_type_assets".* FROM "push_type_assets" WHERE (deleted_at IS NOT NULL) ORDER BY "push_type_assets"."created_at" DESC LIMIT $1 OFFSET $2 [["LIMIT", 12], ["OFFSET", 0]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [3 times] (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/index.json.jbuilder (3.2ms) Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::POST #create::with in-valid asset: test_0001_anonymous -------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::AssetsController#create as JSON Parameters: {"asset"=>{}}  (0.1ms) SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::POST #create::with in-valid asset: test_0002_anonymous -------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::AssetsController#create as JSON Parameters: {"asset"=>{}}  (0.1ms) SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_2 Completed 422 Unprocessable Entity in 1ms (Views: 0.1ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with parent scope: test_0001_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-70"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-70"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2db24200003b215eedbd9ebc4f9112ac SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["descendant_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t71069116133b6a7e211f5dbbd6a9080b  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-71"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-71"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t224fe789fe6f5205c2f54a03b151d77a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7a5b0eb2-4695-485b-8243-af5137aa63af"], ["descendant_id", "7a5b0eb2-4695-485b-8243-af5137aa63af"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '7a5b0eb2-4695-485b-8243-af5137aa63af', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'fcf1cfa4-482b-4432-b509-b315abd8862a'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'fcf1cfa4-482b-4432-b509-b315abd8862a' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7a5b0eb2-4695-485b-8243-af5137aa63af"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7a5b0eb2-4695-485b-8243-af5137aa63af"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7a5b0eb2-4695-485b-8243-af5137aa63af"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tcea4a5343fb485c3644c808c99ad41a3  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-72"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-72"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t221c273b546e120b657e1d37ebfad613 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "5720c352-bb3e-4895-8f5e-de33cded71dd"], ["descendant_id", "5720c352-bb3e-4895-8f5e-de33cded71dd"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '5720c352-bb3e-4895-8f5e-de33cded71dd', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'fcf1cfa4-482b-4432-b509-b315abd8862a'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'fcf1cfa4-482b-4432-b509-b315abd8862a' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "5720c352-bb3e-4895-8f5e-de33cded71dd"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "5720c352-bb3e-4895-8f5e-de33cded71dd"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "5720c352-bb3e-4895-8f5e-de33cded71dd"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t4af708b9e0a47cdb6f37455a96075c77  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-73"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-73"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8d85dad5168a958509325f577018f5bc SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "1b3d9279-f9da-4940-b961-3d187469490f"], ["descendant_id", "1b3d9279-f9da-4940-b961-3d187469490f"], ["generations", 0]]  (0.1ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '1b3d9279-f9da-4940-b961-3d187469490f', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'fcf1cfa4-482b-4432-b509-b315abd8862a'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'fcf1cfa4-482b-4432-b509-b315abd8862a' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "1b3d9279-f9da-4940-b961-3d187469490f"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "1b3d9279-f9da-4940-b961-3d187469490f"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "1b3d9279-f9da-4940-b961-3d187469490f"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t765971bd29620a423e50d8152e528900  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-74"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-74"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t637a550d5c09a8088c136d419da4da6d SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "fa1a2753-543e-4d2c-8592-518aa8f43b05"], ["descendant_id", "fa1a2753-543e-4d2c-8592-518aa8f43b05"], ["generations", 0]]  (0.1ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'fa1a2753-543e-4d2c-8592-518aa8f43b05', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'fcf1cfa4-482b-4432-b509-b315abd8862a'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'fcf1cfa4-482b-4432-b509-b315abd8862a' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fa1a2753-543e-4d2c-8592-518aa8f43b05"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "fa1a2753-543e-4d2c-8592-518aa8f43b05"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "fa1a2753-543e-4d2c-8592-518aa8f43b05"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t32c3c037e3c9ceb743efde6abece6c1a  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-75"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-75"], ["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4d661fdb1cd045af3c38a724b9170ac2 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "19713b1e-6682-4c98-8ca0-5b0615ce23d5"], ["descendant_id", "19713b1e-6682-4c98-8ca0-5b0615ce23d5"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '19713b1e-6682-4c98-8ca0-5b0615ce23d5', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'fcf1cfa4-482b-4432-b509-b315abd8862a'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'fcf1cfa4-482b-4432-b509-b315abd8862a' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "19713b1e-6682-4c98-8ca0-5b0615ce23d5"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "19713b1e-6682-4c98-8ca0-5b0615ce23d5"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "19713b1e-6682-4c98-8ca0-5b0615ce23d5"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t988edafd6dce5cc1b0da7bf4b0d863ab  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node_id"=>"fcf1cfa4-482b-4432-b509-b315abd8862a", "node"=>{}} PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $2 OFFSET $3 [["parent_id", "fcf1cfa4-482b-4432-b509-b315abd8862a"], ["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "7a5b0eb2-4695-485b-8243-af5137aa63af"]]  (0.4ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "7a5b0eb2-4695-485b-8243-af5137aa63af"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.2ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "5720c352-bb3e-4895-8f5e-de33cded71dd"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "5720c352-bb3e-4895-8f5e-de33cded71dd"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "1b3d9279-f9da-4940-b961-3d187469490f"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "1b3d9279-f9da-4940-b961-3d187469490f"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "fa1a2753-543e-4d2c-8592-518aa8f43b05"]]  (0.3ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "fa1a2753-543e-4d2c-8592-518aa8f43b05"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.1ms) PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "19713b1e-6682-4c98-8ca0-5b0615ce23d5"]]  (4.6ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "19713b1e-6682-4c98-8ca0-5b0615ce23d5"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (10.1ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.9ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (31.7ms) Completed 200 OK in 36ms (Views: 24.4ms | ActiveRecord: 8.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with parent scope: test_0002_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-76"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-76"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t03d532b30129202938941eaece72a26c SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["descendant_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t2d2285085d139bf92f21ee79f3f3c167  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-77"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-77"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tf872b06b939a16bc2d7d4ab2f776ba42 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "238a4513-cd3c-47bd-b9ce-76e6aefbd65a"], ["descendant_id", "238a4513-cd3c-47bd-b9ce-76e6aefbd65a"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '238a4513-cd3c-47bd-b9ce-76e6aefbd65a', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'b809c520-7500-4570-89da-53221d01dfa1'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'b809c520-7500-4570-89da-53221d01dfa1' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "238a4513-cd3c-47bd-b9ce-76e6aefbd65a"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "238a4513-cd3c-47bd-b9ce-76e6aefbd65a"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "238a4513-cd3c-47bd-b9ce-76e6aefbd65a"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te13e640871e17861296debdd5402a29f  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.3ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-78"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-78"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t1b608ddf91761760a2e2bfc9fb253760 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "44e368c9-5c98-4c39-854e-b1ceb5edb37b"], ["descendant_id", "44e368c9-5c98-4c39-854e-b1ceb5edb37b"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '44e368c9-5c98-4c39-854e-b1ceb5edb37b', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'b809c520-7500-4570-89da-53221d01dfa1'   (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'b809c520-7500-4570-89da-53221d01dfa1' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "44e368c9-5c98-4c39-854e-b1ceb5edb37b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "44e368c9-5c98-4c39-854e-b1ceb5edb37b"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "44e368c9-5c98-4c39-854e-b1ceb5edb37b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t5bd835b9afd441ca4506bbd9cedc1052  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-79"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-79"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tbd6d997f842a1f677cfbbb03bdb90fa4 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "974803f3-d949-45a4-bb9b-4957d4cb47cd"], ["descendant_id", "974803f3-d949-45a4-bb9b-4957d4cb47cd"], ["generations", 0]]  (0.3ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '974803f3-d949-45a4-bb9b-4957d4cb47cd', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'b809c520-7500-4570-89da-53221d01dfa1'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'b809c520-7500-4570-89da-53221d01dfa1' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "974803f3-d949-45a4-bb9b-4957d4cb47cd"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "974803f3-d949-45a4-bb9b-4957d4cb47cd"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "974803f3-d949-45a4-bb9b-4957d4cb47cd"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tc840542c450011295c434b6f5f36922e  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-80"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-80"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t67ba8745d1fafe5add4f749b8b01a43e SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "b0e65589-154c-4344-93ac-71dd5666f148"], ["descendant_id", "b0e65589-154c-4344-93ac-71dd5666f148"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'b0e65589-154c-4344-93ac-71dd5666f148', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'b809c520-7500-4570-89da-53221d01dfa1'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'b809c520-7500-4570-89da-53221d01dfa1' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b0e65589-154c-4344-93ac-71dd5666f148"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "b0e65589-154c-4344-93ac-71dd5666f148"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "b0e65589-154c-4344-93ac-71dd5666f148"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t22ba80f4a38c1a7d0cf85bfcf1d33f33  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-81"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-81"], ["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4c65c11a59456d964e967ef6c127b4d2 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "5bc1a64e-1244-4573-8855-90b5cf24429b"], ["descendant_id", "5bc1a64e-1244-4573-8855-90b5cf24429b"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '5bc1a64e-1244-4573-8855-90b5cf24429b', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'b809c520-7500-4570-89da-53221d01dfa1'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'b809c520-7500-4570-89da-53221d01dfa1' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "5bc1a64e-1244-4573-8855-90b5cf24429b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "5bc1a64e-1244-4573-8855-90b5cf24429b"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "5bc1a64e-1244-4573-8855-90b5cf24429b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t3e604d871c535e8dd9358fe23c22fa37  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node_id"=>"b809c520-7500-4570-89da-53221d01dfa1", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $2 OFFSET $3 [["parent_id", "b809c520-7500-4570-89da-53221d01dfa1"], ["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "238a4513-cd3c-47bd-b9ce-76e6aefbd65a"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "238a4513-cd3c-47bd-b9ce-76e6aefbd65a"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.1ms) PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "44e368c9-5c98-4c39-854e-b1ceb5edb37b"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "44e368c9-5c98-4c39-854e-b1ceb5edb37b"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.1ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "974803f3-d949-45a4-bb9b-4957d4cb47cd"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "974803f3-d949-45a4-bb9b-4957d4cb47cd"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "b0e65589-154c-4344-93ac-71dd5666f148"]]  (0.5ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "b0e65589-154c-4344-93ac-71dd5666f148"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.7ms) PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "5bc1a64e-1244-4573-8855-90b5cf24429b"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "5bc1a64e-1244-4573-8855-90b5cf24429b"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (5.1ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [5 times] (0.3ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (25.2ms) Completed 200 OK in 28ms (Views: 22.4ms | ActiveRecord: 3.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::UsersControllerTest::GET #show: test_0003_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-32@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-32@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#show as JSON Parameters: {"id"=>"9c3f34f6-2a5a-424f-9cc3-15f0e888c88a", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "9c3f34f6-2a5a-424f-9cc3-15f0e888c88a"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.5ms) Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::UsersControllerTest::GET #show: test_0004_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-33@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-33@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#show as JSON Parameters: {"id"=>"d79da9c3-0f3f-41d4-b70c-3ba976595d2d", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "d79da9c3-0f3f-41d4-b70c-3ba976595d2d"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.5ms) Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::UsersControllerTest::GET #show: test_0001_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-34@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-34@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#show as JSON Parameters: {"id"=>"5d977c46-a687-4b18-89ae-680317edb06a", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "5d977c46-a687-4b18-89ae-680317edb06a"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.4ms) Completed 200 OK in 2ms (Views: 0.7ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::UsersControllerTest::GET #show: test_0002_anonymous ------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::User Exists (0.1ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-35@example.com"], ["LIMIT", 1]] SQL (0.1ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-35@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#show as JSON Parameters: {"id"=>"0a596942-8239-4a4d-8328-15aa54a67358", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "0a596942-8239-4a4d-8328-15aa54a67358"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.4ms) Completed 200 OK in 2ms (Views: 0.8ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ PushType::Api::UsersControllerTest::GET #show: test_0005_anonymous ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::User Exists (0.2ms) SELECT 1 AS one FROM "push_type_users" WHERE "push_type_users"."email" = $1 LIMIT $2 [["email", "joe-36@example.com"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_users" ("name", "email", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["name", "Joe Bloggs"], ["email", "joe-36@example.com"], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::UsersController#show as JSON Parameters: {"id"=>"b7a578b8-e411-46c2-b086-b83915af4733", "user"=>{}} PushType::User Load (0.1ms) SELECT "push_type_users".* FROM "push_type_users" WHERE "push_type_users"."id" = $1 ORDER BY "push_type_users"."name" ASC LIMIT $2 [["id", "b7a578b8-e411-46c2-b086-b83915af4733"], ["LIMIT", 1]] Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/_user.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/users/show.json.jbuilder (0.7ms) Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #create::with valid node: test_0001_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-82"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-82"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tca85930ba395f08062e025d1800d6a06 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d298ffc5-30fa-4a67-93eb-da9148edefee"], ["descendant_id", "d298ffc5-30fa-4a67-93eb-da9148edefee"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d298ffc5-30fa-4a67-93eb-da9148edefee"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d298ffc5-30fa-4a67-93eb-da9148edefee"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d298ffc5-30fa-4a67-93eb-da9148edefee"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t66d4f3dc6fd0f41061792a8df0a9fa50  (0.2ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') Processing by PushType::Api::NodesController#create as JSON Parameters: {"node"=>{"title"=>"Foo bar", "slug"=>"foo-bar-83", "type"=>"Page"}}  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-83"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-83"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2352d96cbd42fac8b392fbeed841f463 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "5be6dd0a-7d01-4a23-8291-fb31f43fb84c"], ["descendant_id", "5be6dd0a-7d01-4a23-8291-fb31f43fb84c"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "5be6dd0a-7d01-4a23-8291-fb31f43fb84c"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "5be6dd0a-7d01-4a23-8291-fb31f43fb84c"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "5be6dd0a-7d01-4a23-8291-fb31f43fb84c"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t12a0ac865b7819951e98162b1be3b4c5  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "5be6dd0a-7d01-4a23-8291-fb31f43fb84c"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "5be6dd0a-7d01-4a23-8291-fb31f43fb84c"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (3.5ms) Completed 201 Created in 14ms (Views: 3.4ms | ActiveRecord: 2.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #create::with valid node: test_0002_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-84"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-84"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5d293b23d5edaae820bda0d552f53111 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "3cde9176-6b0b-496e-8542-7d106552f9cd"], ["descendant_id", "3cde9176-6b0b-496e-8542-7d106552f9cd"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "3cde9176-6b0b-496e-8542-7d106552f9cd"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "3cde9176-6b0b-496e-8542-7d106552f9cd"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "3cde9176-6b0b-496e-8542-7d106552f9cd"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8fd026d4beed7e99454db6450bdf35f4  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') Processing by PushType::Api::NodesController#create as JSON Parameters: {"node"=>{"title"=>"Foo bar", "slug"=>"foo-bar-85", "type"=>"Page"}}  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-85"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-85"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t0185981be39b4c627173b2a1aa618148 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "1a222de1-0db0-4e71-b9c2-e7ddb89f5416"], ["descendant_id", "1a222de1-0db0-4e71-b9c2-e7ddb89f5416"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "1a222de1-0db0-4e71-b9c2-e7ddb89f5416"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "1a222de1-0db0-4e71-b9c2-e7ddb89f5416"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "1a222de1-0db0-4e71-b9c2-e7ddb89f5416"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t161106d7e309347182419b0bbbca6422  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "1a222de1-0db0-4e71-b9c2-e7ddb89f5416"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "1a222de1-0db0-4e71-b9c2-e7ddb89f5416"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.0ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (3.4ms) Completed 201 Created in 14ms (Views: 3.5ms | ActiveRecord: 2.5ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #create::with valid node: test_0003_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-86"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-86"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5cd4f1a5392b07339ec23bfb44c001e7 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "61fe57d6-5810-4a3a-98c2-cdd4d4b81278"], ["descendant_id", "61fe57d6-5810-4a3a-98c2-cdd4d4b81278"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "61fe57d6-5810-4a3a-98c2-cdd4d4b81278"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "61fe57d6-5810-4a3a-98c2-cdd4d4b81278"], ["LIMIT", 1000]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "61fe57d6-5810-4a3a-98c2-cdd4d4b81278"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS t82070742e7b43b16903c71c4979bf2c3  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.4ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') Processing by PushType::Api::NodesController#create as JSON Parameters: {"node"=>{"title"=>"Foo bar", "slug"=>"foo-bar-87", "type"=>"Page"}}  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-87"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-87"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t48368bcb1b5f7b83da6c8c374faeaffe SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "66fc2cb0-32ae-4fcb-b2a1-c69b2e0647e2"], ["descendant_id", "66fc2cb0-32ae-4fcb-b2a1-c69b2e0647e2"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "66fc2cb0-32ae-4fcb-b2a1-c69b2e0647e2"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "66fc2cb0-32ae-4fcb-b2a1-c69b2e0647e2"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "66fc2cb0-32ae-4fcb-b2a1-c69b2e0647e2"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t513dffb67c487e001c56497088486acd  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "66fc2cb0-32ae-4fcb-b2a1-c69b2e0647e2"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "66fc2cb0-32ae-4fcb-b2a1-c69b2e0647e2"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (2.9ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (3.3ms) Completed 201 Created in 14ms (Views: 3.4ms | ActiveRecord: 2.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #create::with valid node: test_0004_anonymous --------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-88"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-88"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t147189a025dd9c69fd3e1ea6e3f95581 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "8772a7b2-e731-4292-b32c-ca4a411131e6"], ["descendant_id", "8772a7b2-e731-4292-b32c-ca4a411131e6"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "8772a7b2-e731-4292-b32c-ca4a411131e6"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "8772a7b2-e731-4292-b32c-ca4a411131e6"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "8772a7b2-e731-4292-b32c-ca4a411131e6"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t9e4dbee0e1e13b4cd727f52eb6972e4f  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') Processing by PushType::Api::NodesController#create as JSON Parameters: {"node"=>{"title"=>"Foo bar", "slug"=>"foo-bar-89", "type"=>"Page"}}  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-89"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-89"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t10af991055b48b100cbd51360c2375ee SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "b1009170-90dc-44e5-a9af-75e7b27f432d"], ["descendant_id", "b1009170-90dc-44e5-a9af-75e7b27f432d"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b1009170-90dc-44e5-a9af-75e7b27f432d"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "b1009170-90dc-44e5-a9af-75e7b27f432d"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "b1009170-90dc-44e5-a9af-75e7b27f432d"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb2a4b2e74ff5d3f7fd4013290ed71920  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "b1009170-90dc-44e5-a9af-75e7b27f432d"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "b1009170-90dc-44e5-a9af-75e7b27f432d"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/show.json.jbuilder (4.0ms) Completed 201 Created in 14ms (Views: 4.0ms | ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page')  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #destroy::with trashed node: test_0002_anonymous -------------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-90"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-90"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t15b7baed6065721ce3733012cdd4dedf SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"], ["descendant_id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tfe48de769d06ecbac3db02e89210a83c  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_nodes"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.5ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.871118' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != 'fac40935-92ca-4ab1-92ac-84e8a51dddab') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"]] Processing by PushType::Api::NodesController#destroy as JSON Parameters: {"id"=>"fac40935-92ca-4ab1-92ac-84e8a51dddab", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4b22295c3dd8915e78a3fe3799df1faa  (0.3ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = 'fac40935-92ca-4ab1-92ac-84e8a51dddab' OR descendant_id = 'fac40935-92ca-4ab1-92ac-84e8a51dddab' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0ac65163a011d2ed8baf77e2140d98a8 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"]] SQL (0.2ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 [["id", "fac40935-92ca-4ab1-92ac-84e8a51dddab"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 5ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #destroy::with trashed node: test_0001_anonymous -------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-91"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-91"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t93369304beae5e47da18a35ebcd1e186 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"], ["descendant_id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t9249421a97777fe18833975b6107424b  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_nodes"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (0.4ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.892884' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '6d892cdc-91a4-40dd-b6dc-643cd175e90a') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"]] Processing by PushType::Api::NodesController#destroy as JSON Parameters: {"id"=>"6d892cdc-91a4-40dd-b6dc-643cd175e90a", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tc684d23f4015e749fe45c904ef4a3e2c  (0.3ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '6d892cdc-91a4-40dd-b6dc-643cd175e90a' OR descendant_id = '6d892cdc-91a4-40dd-b6dc-643cd175e90a' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te94e686f023a780ab84003584c91d837 PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 [["id", "6d892cdc-91a4-40dd-b6dc-643cd175e90a"]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 4ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #destroy::with trashed node: test_0003_anonymous -------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-92"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-92"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t9c71faf80e0295eea0a4fa3014de577c SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"], ["descendant_id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS t879f9dd68432e2d17bff54bd52e077e2  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) UPDATE "push_type_nodes" SET "updated_at" = $1, "deleted_at" = $2 WHERE "push_type_nodes"."id" = $3 [["updated_at", 2017-04-07 12:50:16 UTC], ["deleted_at", 2017-04-07 12:50:16 UTC], ["id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 SQL (1.1ms) UPDATE "push_type_nodes" SET "deleted_at" = '2017-04-07 12:50:16.914003' WHERE "push_type_nodes"."id" IN (SELECT "push_type_nodes"."id" FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."descendant_id" WHERE "push_type_node_hierarchies"."ancestor_id" = $1 AND ("push_type_nodes"."id" != '7a5c57b3-8140-4c4a-9a38-1c42d2fb4761') ORDER BY "push_type_node_hierarchies".generations asc, sort_order) [["ancestor_id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"]] Processing by PushType::Api::NodesController#destroy as JSON Parameters: {"id"=>"7a5c57b3-8140-4c4a-9a38-1c42d2fb4761", "node"=>{}} PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t43b9125e2d34ffe6f4ee269677652de1  (0.6ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '7a5c57b3-8140-4c4a-9a38-1c42d2fb4761' OR descendant_id = '7a5c57b3-8140-4c4a-9a38-1c42d2fb4761' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tdaa4f404422bf7a81cddc833ebafe7fc PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"]] SQL (0.2ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 [["id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 5ms (ActiveRecord: 1.8ms) Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7a5c57b3-8140-4c4a-9a38-1c42d2fb4761"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ---------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with no scope: test_0005_anonymous ----------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-93"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-93"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t0bfba0654fa0a4eb3a2cbf404d510ead SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["descendant_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te45b110ba5e0db06bc3a1870637132dc  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-94"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-94"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t1cf6d2e9455a4dcf49f85107dcd200cd SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "17952eaf-6924-4983-abcb-3d8dfa4b0781"], ["descendant_id", "17952eaf-6924-4983-abcb-3d8dfa4b0781"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '17952eaf-6924-4983-abcb-3d8dfa4b0781', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'ecd61438-3180-4b8c-897c-1eacd83900fa'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'ecd61438-3180-4b8c-897c-1eacd83900fa' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "17952eaf-6924-4983-abcb-3d8dfa4b0781"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "17952eaf-6924-4983-abcb-3d8dfa4b0781"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "17952eaf-6924-4983-abcb-3d8dfa4b0781"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0413c64def5544ba273e21c1cdb01d6f  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-95"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-95"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t67b5f5c43e185675041ebcea3c76acd8 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d486a623-d22c-4281-b04f-d0dd03197431"], ["descendant_id", "d486a623-d22c-4281-b04f-d0dd03197431"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'd486a623-d22c-4281-b04f-d0dd03197431', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'ecd61438-3180-4b8c-897c-1eacd83900fa'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'ecd61438-3180-4b8c-897c-1eacd83900fa' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d486a623-d22c-4281-b04f-d0dd03197431"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.4ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d486a623-d22c-4281-b04f-d0dd03197431"], ["LIMIT", 1000]] PushType::Node Load (0.6ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d486a623-d22c-4281-b04f-d0dd03197431"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS t3b03f0a80ae4e03f2e4cb30e46a07b2e  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-96"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-96"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t79fc83bb26cc106142e7be79b51293f2 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d377c914-5fc4-4d33-81af-7fd558590263"], ["descendant_id", "d377c914-5fc4-4d33-81af-7fd558590263"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'd377c914-5fc4-4d33-81af-7fd558590263', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'ecd61438-3180-4b8c-897c-1eacd83900fa'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'ecd61438-3180-4b8c-897c-1eacd83900fa' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d377c914-5fc4-4d33-81af-7fd558590263"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d377c914-5fc4-4d33-81af-7fd558590263"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d377c914-5fc4-4d33-81af-7fd558590263"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te01300e0e77f0f87bee1938d8ebc0c0d  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-97"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-97"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t0101328ab9097485fcadab8c15575550 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "86a22189-317b-44f8-8a5f-6b1b86255a22"], ["descendant_id", "86a22189-317b-44f8-8a5f-6b1b86255a22"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '86a22189-317b-44f8-8a5f-6b1b86255a22', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'ecd61438-3180-4b8c-897c-1eacd83900fa'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'ecd61438-3180-4b8c-897c-1eacd83900fa' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "86a22189-317b-44f8-8a5f-6b1b86255a22"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "86a22189-317b-44f8-8a5f-6b1b86255a22"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "86a22189-317b-44f8-8a5f-6b1b86255a22"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t4c1f940bdbe75e6c3a89d2e692837f49  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-98"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-98"], ["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"], ["status", 0], ["created_at", 2017-04-07 12:50:16 UTC], ["updated_at", 2017-04-07 12:50:16 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t6fbe27d11cdc9139fb32574cf544904b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "e964ad36-6a0a-4a11-9cf7-f2c6d73d4438"], ["descendant_id", "e964ad36-6a0a-4a11-9cf7-f2c6d73d4438"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'e964ad36-6a0a-4a11-9cf7-f2c6d73d4438', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'ecd61438-3180-4b8c-897c-1eacd83900fa'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'ecd61438-3180-4b8c-897c-1eacd83900fa' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "e964ad36-6a0a-4a11-9cf7-f2c6d73d4438"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "e964ad36-6a0a-4a11-9cf7-f2c6d73d4438"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "e964ad36-6a0a-4a11-9cf7-f2c6d73d4438"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8cbfb07b5f654c8d57e14e057d5a88fe  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "ecd61438-3180-4b8c-897c-1eacd83900fa"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [1 times] (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (4.9ms) Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with no scope: test_0001_anonymous ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-99"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-99"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tdf44bbe19870370431194f49d50167fe SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["descendant_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t7fb9bb118c1b8131e2272e3b5afe37b9  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-100"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-100"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta59a95d365c78ab0f5c359493c5902b3 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "89b532f4-3f4f-40f4-9e9f-5474cbde1484"], ["descendant_id", "89b532f4-3f4f-40f4-9e9f-5474cbde1484"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '89b532f4-3f4f-40f4-9e9f-5474cbde1484', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd643d64d-8cd0-4089-a8fa-722640e96cee'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd643d64d-8cd0-4089-a8fa-722640e96cee' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "89b532f4-3f4f-40f4-9e9f-5474cbde1484"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "89b532f4-3f4f-40f4-9e9f-5474cbde1484"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "89b532f4-3f4f-40f4-9e9f-5474cbde1484"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t971c4141bd50acf6dbeec4756a9efc23  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-101"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-101"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t64a04e23a6af8cab0f75abe65f302d5f SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "81ff779c-4284-44d7-bf02-9ae3024a3464"], ["descendant_id", "81ff779c-4284-44d7-bf02-9ae3024a3464"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '81ff779c-4284-44d7-bf02-9ae3024a3464', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd643d64d-8cd0-4089-a8fa-722640e96cee'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd643d64d-8cd0-4089-a8fa-722640e96cee' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "81ff779c-4284-44d7-bf02-9ae3024a3464"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "81ff779c-4284-44d7-bf02-9ae3024a3464"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "81ff779c-4284-44d7-bf02-9ae3024a3464"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb432467b7723baa75715e3a463bc0e32  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-102"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-102"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t62b2208810d6390ec201635bd0307086 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "ae734acc-a94e-4d6e-bd34-bef8a1c94394"], ["descendant_id", "ae734acc-a94e-4d6e-bd34-bef8a1c94394"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'ae734acc-a94e-4d6e-bd34-bef8a1c94394', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd643d64d-8cd0-4089-a8fa-722640e96cee'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd643d64d-8cd0-4089-a8fa-722640e96cee' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "ae734acc-a94e-4d6e-bd34-bef8a1c94394"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "ae734acc-a94e-4d6e-bd34-bef8a1c94394"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "ae734acc-a94e-4d6e-bd34-bef8a1c94394"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t48afbb4e50758cad4d67aef011caad67  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-103"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-103"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta06a9d698889f01d519f9f0c295425cf SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "55e56aca-8758-4e84-bc6e-fe1315a93798"], ["descendant_id", "55e56aca-8758-4e84-bc6e-fe1315a93798"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '55e56aca-8758-4e84-bc6e-fe1315a93798', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd643d64d-8cd0-4089-a8fa-722640e96cee'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd643d64d-8cd0-4089-a8fa-722640e96cee' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "55e56aca-8758-4e84-bc6e-fe1315a93798"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "55e56aca-8758-4e84-bc6e-fe1315a93798"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "55e56aca-8758-4e84-bc6e-fe1315a93798"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te631cfd7789e06ff2c53f875bab443c8  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-104"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-104"], ["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t589eafce2f6b9d4eab9908256ee359c2 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "72116b1a-45ff-45b0-88e0-5ff09fa899f5"], ["descendant_id", "72116b1a-45ff-45b0-88e0-5ff09fa899f5"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '72116b1a-45ff-45b0-88e0-5ff09fa899f5', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd643d64d-8cd0-4089-a8fa-722640e96cee'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd643d64d-8cd0-4089-a8fa-722640e96cee' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "72116b1a-45ff-45b0-88e0-5ff09fa899f5"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "72116b1a-45ff-45b0-88e0-5ff09fa899f5"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "72116b1a-45ff-45b0-88e0-5ff09fa899f5"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t3bdb86af7b0bc1463a85ebc9741a188f  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "d643d64d-8cd0-4089-a8fa-722640e96cee"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.3ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [1 times] (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (4.6ms) Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with no scope: test_0004_anonymous ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-105"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-105"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tbdf86f865bba4eda713d317a3513390a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["descendant_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t606e332c2454d55c7762157986222332  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-106"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-106"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t81ab981e21d69c8cbb19a8fd78ac0ddf SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "9ebf91dc-41d9-40fa-85ec-c8ce4d28ad90"], ["descendant_id", "9ebf91dc-41d9-40fa-85ec-c8ce4d28ad90"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '9ebf91dc-41d9-40fa-85ec-c8ce4d28ad90', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "9ebf91dc-41d9-40fa-85ec-c8ce4d28ad90"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "9ebf91dc-41d9-40fa-85ec-c8ce4d28ad90"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "9ebf91dc-41d9-40fa-85ec-c8ce4d28ad90"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t63a254d577434565be1dc3ac90276caf  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-107"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-107"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2ea6e89f40d3281944538f9c9312bca1 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "01ba05e4-d870-46af-8188-21107183cc8f"], ["descendant_id", "01ba05e4-d870-46af-8188-21107183cc8f"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '01ba05e4-d870-46af-8188-21107183cc8f', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "01ba05e4-d870-46af-8188-21107183cc8f"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "01ba05e4-d870-46af-8188-21107183cc8f"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "01ba05e4-d870-46af-8188-21107183cc8f"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS teccb32ac6fbd7a5624625e1b44effeaf  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-108"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-108"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta67a0d682887c388cdb364dc02d7b31a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "dac699c2-d6e7-481a-9f4b-747a1b95018d"], ["descendant_id", "dac699c2-d6e7-481a-9f4b-747a1b95018d"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'dac699c2-d6e7-481a-9f4b-747a1b95018d', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "dac699c2-d6e7-481a-9f4b-747a1b95018d"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "dac699c2-d6e7-481a-9f4b-747a1b95018d"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "dac699c2-d6e7-481a-9f4b-747a1b95018d"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t722ae21ff171d3aaf46fbc4cf800474a  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] PushType::Node Exists (0.4ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-109"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-109"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t45603e29956f8738cbe8452dcf83d1f9 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "1d809bd3-5ee6-460e-805d-8e6172421934"], ["descendant_id", "1d809bd3-5ee6-460e-805d-8e6172421934"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '1d809bd3-5ee6-460e-805d-8e6172421934', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "1d809bd3-5ee6-460e-805d-8e6172421934"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "1d809bd3-5ee6-460e-805d-8e6172421934"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "1d809bd3-5ee6-460e-805d-8e6172421934"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb475a96864c3fd93856f034a92db95ab  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-110"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-110"], ["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5f74f3208aa3541174476eb441326da4 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d54da6bc-b42b-4ce6-8031-53c1a4dc878b"], ["descendant_id", "d54da6bc-b42b-4ce6-8031-53c1a4dc878b"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'd54da6bc-b42b-4ce6-8031-53c1a4dc878b', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '7ba517fe-2c08-4213-aee5-f2b89ff2deb4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d54da6bc-b42b-4ce6-8031-53c1a4dc878b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d54da6bc-b42b-4ce6-8031-53c1a4dc878b"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d54da6bc-b42b-4ce6-8031-53c1a4dc878b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS ta575754eb44911734405d8809a2359b1  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "7ba517fe-2c08-4213-aee5-f2b89ff2deb4"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.2ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [1 times] (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (4.5ms) Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with no scope: test_0006_anonymous ----------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-111"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-111"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t62a5d9aa2483c433735b62fcccef11b4 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["descendant_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tc6e52336e55476bb536117e2ace94e3b  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-112"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-112"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tf1d5500684bfd4c380b0bc5ceb3301fb SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "6c94ee78-3597-4564-942d-fc2da6998260"], ["descendant_id", "6c94ee78-3597-4564-942d-fc2da6998260"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '6c94ee78-3597-4564-942d-fc2da6998260', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "6c94ee78-3597-4564-942d-fc2da6998260"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "6c94ee78-3597-4564-942d-fc2da6998260"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "6c94ee78-3597-4564-942d-fc2da6998260"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS td6ae65ea827c29e14cf312eb9170550d  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-113"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-113"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t01613a34f83cad560fb5a8d541edc21c SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "86dee60b-1b26-4911-8506-c1928e102fed"], ["descendant_id", "86dee60b-1b26-4911-8506-c1928e102fed"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '86dee60b-1b26-4911-8506-c1928e102fed', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "86dee60b-1b26-4911-8506-c1928e102fed"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "86dee60b-1b26-4911-8506-c1928e102fed"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "86dee60b-1b26-4911-8506-c1928e102fed"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb37b13af5214d63c988d4c80184a526f  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-114"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-114"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS taeb02e53fc15898c1a3d1d447e007dd9 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "192cfc35-d220-45b5-ab3d-b144ff3ce3c9"], ["descendant_id", "192cfc35-d220-45b5-ab3d-b144ff3ce3c9"], ["generations", 0]]  (0.1ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '192cfc35-d220-45b5-ab3d-b144ff3ce3c9', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "192cfc35-d220-45b5-ab3d-b144ff3ce3c9"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "192cfc35-d220-45b5-ab3d-b144ff3ce3c9"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "192cfc35-d220-45b5-ab3d-b144ff3ce3c9"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t508f122206c42b24c34021d11792eac5  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-115"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-115"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tb124a0346d878ca0a018dd5cfdb72b75 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "56a4889b-2c8c-40f9-a34b-b7ebca9c749c"], ["descendant_id", "56a4889b-2c8c-40f9-a34b-b7ebca9c749c"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '56a4889b-2c8c-40f9-a34b-b7ebca9c749c', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "56a4889b-2c8c-40f9-a34b-b7ebca9c749c"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "56a4889b-2c8c-40f9-a34b-b7ebca9c749c"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "56a4889b-2c8c-40f9-a34b-b7ebca9c749c"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tdf9464427500aacf3bcdaa916508eb47  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-116"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-116"], ["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t1dfef7191a7c5ceedb3097bdf92de6b6 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "b41385da-9ecb-4946-9071-b408e3541793"], ["descendant_id", "b41385da-9ecb-4946-9071-b408e3541793"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'b41385da-9ecb-4946-9071-b408e3541793', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = '160b1f9d-2bfa-4426-af0d-a9d1fe759e76' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "b41385da-9ecb-4946-9071-b408e3541793"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "b41385da-9ecb-4946-9071-b408e3541793"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "b41385da-9ecb-4946-9071-b408e3541793"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t084c544791d6634babe2a8497ff8988b  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"]]  (0.2ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "160b1f9d-2bfa-4426-af0d-a9d1fe759e76"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (4.6ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [1 times] (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (6.3ms) Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.7ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with no scope: test_0003_anonymous ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-117"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-117"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t86fa2c6119a309a1aae8eaaae8ed44b8 SQL (0.3ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["descendant_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["generations", 0]]  (0.5ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (1.8ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tab176b039150eeaeb20a6544c06e1826  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-118"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-118"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tbe12c4f551e81abbb9655cc5833038a6 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "6fe1a7aa-cb8b-4109-bd05-35e1fb615cff"], ["descendant_id", "6fe1a7aa-cb8b-4109-bd05-35e1fb615cff"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '6fe1a7aa-cb8b-4109-bd05-35e1fb615cff', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "6fe1a7aa-cb8b-4109-bd05-35e1fb615cff"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "6fe1a7aa-cb8b-4109-bd05-35e1fb615cff"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "6fe1a7aa-cb8b-4109-bd05-35e1fb615cff"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tf8e66a1e98249fe3a4ab5c6369cf9457  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-119"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-119"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t2e841071b4741abbb7de760e22aba09a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7ca35749-4d11-40c7-96e0-fd9cead1e1ad"], ["descendant_id", "7ca35749-4d11-40c7-96e0-fd9cead1e1ad"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '7ca35749-4d11-40c7-96e0-fd9cead1e1ad', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7ca35749-4d11-40c7-96e0-fd9cead1e1ad"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7ca35749-4d11-40c7-96e0-fd9cead1e1ad"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7ca35749-4d11-40c7-96e0-fd9cead1e1ad"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb4fd8917b5cd3188e5791a4e8b6b9c96  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-120"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-120"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t098ade4fc5bc782b28ae7a028fb01c59 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "894dc9ba-ab55-4262-a2f0-76083fa1baf5"], ["descendant_id", "894dc9ba-ab55-4262-a2f0-76083fa1baf5"], ["generations", 0]]  (0.1ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '894dc9ba-ab55-4262-a2f0-76083fa1baf5', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "894dc9ba-ab55-4262-a2f0-76083fa1baf5"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "894dc9ba-ab55-4262-a2f0-76083fa1baf5"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "894dc9ba-ab55-4262-a2f0-76083fa1baf5"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t475b9db9cf8560dd6e8cb011fac52ce9  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-121"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-121"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8b409c0ba145afedad04e41468da9cb9 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7a6b2869-d9e9-43f0-810f-6cd2ae452f75"], ["descendant_id", "7a6b2869-d9e9-43f0-810f-6cd2ae452f75"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '7a6b2869-d9e9-43f0-810f-6cd2ae452f75', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7a6b2869-d9e9-43f0-810f-6cd2ae452f75"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7a6b2869-d9e9-43f0-810f-6cd2ae452f75"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7a6b2869-d9e9-43f0-810f-6cd2ae452f75"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0a6e9345d8fdda04f27e742e17ca7dd2  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-122"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-122"], ["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t567e37d16c9045f2c5d3069b5088b1a6 SQL (0.3ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "3334c8dc-fd09-4f98-8c3a-2bac6ee6d316"], ["descendant_id", "3334c8dc-fd09-4f98-8c3a-2bac6ee6d316"], ["generations", 0]]  (0.4ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '3334c8dc-fd09-4f98-8c3a-2bac6ee6d316', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4'   (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'd0156c0c-8d5b-4c00-9c1e-5d499c4985e4' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "3334c8dc-fd09-4f98-8c3a-2bac6ee6d316"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "3334c8dc-fd09-4f98-8c3a-2bac6ee6d316"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "3334c8dc-fd09-4f98-8c3a-2bac6ee6d316"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8735b1000b4cce022481c51daf93e69f  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "d0156c0c-8d5b-4c00-9c1e-5d499c4985e4"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.6ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [1 times] (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (4.9ms) Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.7ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::GET #index::with no scope: test_0002_anonymous ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-123"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-123"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS tf1537cc91b4cfbde4fe4c206774a1d0b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["descendant_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8aa5329a9e638c4aca69a950e4ba27b7  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-124"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-124"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta8833c60e35148e030fc39261f2a270c SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "39b10d0c-5bb6-4013-82de-08075a1e1601"], ["descendant_id", "39b10d0c-5bb6-4013-82de-08075a1e1601"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '39b10d0c-5bb6-4013-82de-08075a1e1601', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "39b10d0c-5bb6-4013-82de-08075a1e1601"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "39b10d0c-5bb6-4013-82de-08075a1e1601"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "39b10d0c-5bb6-4013-82de-08075a1e1601"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t4a64505f9d9e634af61c645b26b101de  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-125"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-125"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta464c7862617466a931695fc930975f2 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "f2bdaf3e-22dc-4cbf-b3cd-66bf7a167eba"], ["descendant_id", "f2bdaf3e-22dc-4cbf-b3cd-66bf7a167eba"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'f2bdaf3e-22dc-4cbf-b3cd-66bf7a167eba', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d'   (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "f2bdaf3e-22dc-4cbf-b3cd-66bf7a167eba"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "f2bdaf3e-22dc-4cbf-b3cd-66bf7a167eba"], ["LIMIT", 1000]] PushType::Node Load (0.5ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "f2bdaf3e-22dc-4cbf-b3cd-66bf7a167eba"]]  (0.2ms) SELECT pg_advisory_unlock(1268756593,0) AS tc1cc575a73a68bcf86d24593a9fc3f51  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-126"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-126"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta56502a14416393e5abc80c18e9b96ae SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "c490ab68-e4e2-473a-a75d-0e602b0f8c6a"], ["descendant_id", "c490ab68-e4e2-473a-a75d-0e602b0f8c6a"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, 'c490ab68-e4e2-473a-a75d-0e602b0f8c6a', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c490ab68-e4e2-473a-a75d-0e602b0f8c6a"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "c490ab68-e4e2-473a-a75d-0e602b0f8c6a"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "c490ab68-e4e2-473a-a75d-0e602b0f8c6a"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t44d034ea4a011274e1382aa561d52929  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-127"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-127"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.2ms) SELECT pg_try_advisory_lock(1268756593,0) AS t77a7fe262ec1d40243daddc218964914 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "083b142e-fd87-4ece-94bd-edc8eb04fc89"], ["descendant_id", "083b142e-fd87-4ece-94bd-edc8eb04fc89"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '083b142e-fd87-4ece-94bd-edc8eb04fc89', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d'   (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "083b142e-fd87-4ece-94bd-edc8eb04fc89"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "083b142e-fd87-4ece-94bd-edc8eb04fc89"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "083b142e-fd87-4ece-94bd-edc8eb04fc89"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t84c5db1fd91f564edbfc01cc14a46fc1  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" = $2 LIMIT $3 [["slug", "foo-bar-128"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("type", "title", "slug", "parent_id", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["type", "Page"], ["title", "Foo bar"], ["slug", "foo-bar-128"], ["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS td854e42445edec840508f79f9360ed2b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "189c3776-991f-4040-96e6-f9810e97ece6"], ["descendant_id", "189c3776-991f-4040-96e6-f9810e97ece6"], ["generations", 0]]  (0.2ms) INSERT INTO "push_type_node_hierarchies" (ancestor_id, descendant_id, generations) SELECT x.ancestor_id, '189c3776-991f-4040-96e6-f9810e97ece6', x.generations + 1 FROM "push_type_node_hierarchies" x WHERE x.descendant_id = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d'   (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" = 'c15c809e-b5a2-49cb-ad44-6a34173e0c7d' ) AS t WHERE "push_type_nodes"."id" = t.id  Page Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."type" IN ('Page') AND "push_type_nodes"."id" = $1 LIMIT $2 [["id", "189c3776-991f-4040-96e6-f9810e97ece6"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "189c3776-991f-4040-96e6-f9810e97ece6"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "189c3776-991f-4040-96e6-f9810e97ece6"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb4d668ecfde159aa06d63fa0c28a53ba  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#index as JSON Parameters: {"node"=>{}} Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" IS NULL AND "push_type_nodes"."deleted_at" IS NULL ORDER BY sort_order LIMIT $1 OFFSET $2 [["LIMIT", 30], ["OFFSET", 0]] PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" INNER JOIN "push_type_node_hierarchies" ON "push_type_nodes"."id" = "push_type_node_hierarchies"."ancestor_id" WHERE "push_type_node_hierarchies"."descendant_id" = $1 ORDER BY "push_type_node_hierarchies".generations asc [["descendant_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"]]  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 [["parent_id", "c15c809e-b5a2-49cb-ad44-6a34173e0c7d"]] Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/_node.json.jbuilder (3.5ms) Rendered collection of /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/shared/_pagination.json.jbuilder [1 times] (0.1ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/nodes/index.json.jbuilder (4.9ms) Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ---------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #empty: test_0002_anonymous ----------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-129"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-129"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t63be2026c1fd1da16715351f92ef4cc2 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "45174ae9-74ba-40df-aed8-a84b07f4e875"], ["descendant_id", "45174ae9-74ba-40df-aed8-a84b07f4e875"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "45174ae9-74ba-40df-aed8-a84b07f4e875"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "45174ae9-74ba-40df-aed8-a84b07f4e875"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "45174ae9-74ba-40df-aed8-a84b07f4e875"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tc3e88435ebc15957031227e57429acf6  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-130"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-130"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS td93384b4c25b5b220b8f017371530873 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "547f4c7f-e52c-458e-af5b-0a1851d349a4"], ["descendant_id", "547f4c7f-e52c-458e-af5b-0a1851d349a4"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "547f4c7f-e52c-458e-af5b-0a1851d349a4"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "547f4c7f-e52c-458e-af5b-0a1851d349a4"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "547f4c7f-e52c-458e-af5b-0a1851d349a4"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t6f679a9a9ed8946beac133d034a814be  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-131"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-131"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t93490fd92dc747e2501e17d73daca768 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "d4e319ed-dd77-4376-9f55-bdfdd8547b80"], ["descendant_id", "d4e319ed-dd77-4376-9f55-bdfdd8547b80"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "d4e319ed-dd77-4376-9f55-bdfdd8547b80"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "d4e319ed-dd77-4376-9f55-bdfdd8547b80"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d4e319ed-dd77-4376-9f55-bdfdd8547b80"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t9b24c60b9465c68f812ac0d6fce1fd62  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#empty as JSON Parameters: {"node"=>{}} PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE (deleted_at IS NOT NULL)  (0.1ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tccdc280ca762f301e9246c8b21f1b40c  (0.3ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '45174ae9-74ba-40df-aed8-a84b07f4e875' OR descendant_id = '45174ae9-74ba-40df-aed8-a84b07f4e875' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t9b141fa1e2c16fc22de1c6cff54948a3 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "45174ae9-74ba-40df-aed8-a84b07f4e875"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "45174ae9-74ba-40df-aed8-a84b07f4e875"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5c1779e6075fbaf10e3f67a8d9bb139a  (0.2ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '547f4c7f-e52c-458e-af5b-0a1851d349a4' OR descendant_id = '547f4c7f-e52c-458e-af5b-0a1851d349a4' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t6f0bca6abbccbed72a4f31ef97fc1fef PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "547f4c7f-e52c-458e-af5b-0a1851d349a4"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "547f4c7f-e52c-458e-af5b-0a1851d349a4"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t960700ef4f06cf52c5d873638a4f02ad  (0.2ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = 'd4e319ed-dd77-4376-9f55-bdfdd8547b80' OR descendant_id = 'd4e319ed-dd77-4376-9f55-bdfdd8547b80' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t52c94d1c889b725164b681119c3abc77 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "d4e319ed-dd77-4376-9f55-bdfdd8547b80"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "d4e319ed-dd77-4376-9f55-bdfdd8547b80"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 11ms (ActiveRecord: 3.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ---------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #empty: test_0003_anonymous ----------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-132"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-132"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t46f5b8a3112ea44c2d91090cb7cb96f6 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "535759ad-9cbe-4416-87e2-8d06c8e4787f"], ["descendant_id", "535759ad-9cbe-4416-87e2-8d06c8e4787f"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "535759ad-9cbe-4416-87e2-8d06c8e4787f"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "535759ad-9cbe-4416-87e2-8d06c8e4787f"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "535759ad-9cbe-4416-87e2-8d06c8e4787f"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tf595e27f7f9c776de91aa99a1e5441f5  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-133"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-133"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS td40d65c1458582d4ecb65f2a477513b6 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "40d4febc-cf81-4b69-8384-0009e7c92f56"], ["descendant_id", "40d4febc-cf81-4b69-8384-0009e7c92f56"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "40d4febc-cf81-4b69-8384-0009e7c92f56"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "40d4febc-cf81-4b69-8384-0009e7c92f56"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "40d4febc-cf81-4b69-8384-0009e7c92f56"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0bb5a3f57f6a20cbfdc6695181d5f466  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-134"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-134"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tefd33f02a3ff97dfe09fa46a9855dea9 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "8ada5180-1539-44fe-9123-397e3ad8fe5b"], ["descendant_id", "8ada5180-1539-44fe-9123-397e3ad8fe5b"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "8ada5180-1539-44fe-9123-397e3ad8fe5b"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "8ada5180-1539-44fe-9123-397e3ad8fe5b"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "8ada5180-1539-44fe-9123-397e3ad8fe5b"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8feb11935952b4b738eef1705f16f324  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#empty as JSON Parameters: {"node"=>{}} PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE (deleted_at IS NOT NULL)  (0.1ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tb1c4370039956ac6311a1ce20f0ea4d0  (0.3ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '40d4febc-cf81-4b69-8384-0009e7c92f56' OR descendant_id = '40d4febc-cf81-4b69-8384-0009e7c92f56' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tc89010d898eb13986b5a5f75fee29180 PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "40d4febc-cf81-4b69-8384-0009e7c92f56"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "40d4febc-cf81-4b69-8384-0009e7c92f56"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tcd25e3fac5705c96eef539cba2118d3c  (0.2ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '535759ad-9cbe-4416-87e2-8d06c8e4787f' OR descendant_id = '535759ad-9cbe-4416-87e2-8d06c8e4787f' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tf981df15961d258652ea66860dc5350a PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "535759ad-9cbe-4416-87e2-8d06c8e4787f"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "535759ad-9cbe-4416-87e2-8d06c8e4787f"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5307e0e7565ca4ab2bdeae2cc24d941c  (0.2ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '8ada5180-1539-44fe-9123-397e3ad8fe5b' OR descendant_id = '8ada5180-1539-44fe-9123-397e3ad8fe5b' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tb607ba7bc01ced61f9b2141771b7c72e PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "8ada5180-1539-44fe-9123-397e3ad8fe5b"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "8ada5180-1539-44fe-9123-397e3ad8fe5b"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 10ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "push_type_nodes" WHERE (deleted_at IS NOT NULL)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- PushType::Api::NodesControllerTest::DELETE #empty: test_0001_anonymous ----------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-135"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-135"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8b2582de679a378f24a57f77bd38625a SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "3a16ecd5-a6be-4c4b-97d0-e86dba3469ff"], ["descendant_id", "3a16ecd5-a6be-4c4b-97d0-e86dba3469ff"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "3a16ecd5-a6be-4c4b-97d0-e86dba3469ff"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "3a16ecd5-a6be-4c4b-97d0-e86dba3469ff"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "3a16ecd5-a6be-4c4b-97d0-e86dba3469ff"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0a235fc7c20c88b8ac4b5dc0b8a05ab8  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-136"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-136"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS te84bc1a767a1f099c323a00d436d2371 SQL (0.2ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "51edf2d4-84ab-4ccc-9307-7b523f763615"], ["descendant_id", "51edf2d4-84ab-4ccc-9307-7b523f763615"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "51edf2d4-84ab-4ccc-9307-7b523f763615"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "51edf2d4-84ab-4ccc-9307-7b523f763615"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "51edf2d4-84ab-4ccc-9307-7b523f763615"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tbb162d02de9374be5035133c2e215d7b  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-137"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at", "deleted_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-137"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC], ["deleted_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t595bdc39365244b527956f5ed2c3d06e SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "291a5355-d42e-4b3f-be0f-5245f20f5857"], ["descendant_id", "291a5355-d42e-4b3f-be0f-5245f20f5857"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "291a5355-d42e-4b3f-be0f-5245f20f5857"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "291a5355-d42e-4b3f-be0f-5245f20f5857"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "291a5355-d42e-4b3f-be0f-5245f20f5857"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te9d910f7e8233cacd82f3dba55076296  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#empty as JSON Parameters: {"node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE (deleted_at IS NOT NULL)  (0.1ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5dfd699d1c8c082e77dea67d50766f67  (0.3ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '3a16ecd5-a6be-4c4b-97d0-e86dba3469ff' OR descendant_id = '3a16ecd5-a6be-4c4b-97d0-e86dba3469ff' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t96ed9c142d0aa08f861ab64912ac01db PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "3a16ecd5-a6be-4c4b-97d0-e86dba3469ff"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "3a16ecd5-a6be-4c4b-97d0-e86dba3469ff"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tfa421831332cf120ed59876d0fdf4c18  (0.2ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '51edf2d4-84ab-4ccc-9307-7b523f763615' OR descendant_id = '51edf2d4-84ab-4ccc-9307-7b523f763615' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t0e3367f297fd53ded03376fb67e6234e PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "51edf2d4-84ab-4ccc-9307-7b523f763615"]] SQL (0.1ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "51edf2d4-84ab-4ccc-9307-7b523f763615"]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t1a8625a16d658f1ab767c08abae60a09  (0.2ms) DELETE FROM "push_type_node_hierarchies" WHERE descendant_id IN ( SELECT DISTINCT descendant_id FROM (SELECT descendant_id FROM "push_type_node_hierarchies" WHERE ancestor_id = '291a5355-d42e-4b3f-be0f-5245f20f5857' OR descendant_id = '291a5355-d42e-4b3f-be0f-5245f20f5857' ) AS x )   (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS ta9d584253f6bb808ee8f30fabab45a6f PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "291a5355-d42e-4b3f-be0f-5245f20f5857"]] SQL (0.2ms) DELETE FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 [["id", "291a5355-d42e-4b3f-be0f-5245f20f5857"]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id   (0.1ms) RELEASE SAVEPOINT active_record_2 Completed 204 No Content in 10ms (ActiveRecord: 3.6ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::POST #create::with valid asset: test_0001_anonymous ----------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::AssetsController#create as JSON Parameters: {"asset"=>{"file"=>#, @original_filename="image.png", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"asset[file]\"; filename=\"image.png\"\r\nContent-Type: text/plain\r\nContent-Length: 2643\r\n">}}  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "62"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.6ms) Completed 201 Created in 4ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::POST #create::with valid asset: test_0002_anonymous ----------------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::AssetsController#create as JSON Parameters: {"asset"=>{"file"=>#, @original_filename="image.png", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"asset[file]\"; filename=\"image.png\"\r\nContent-Type: text/plain\r\nContent-Length: 2643\r\n">}}  (0.1ms) SAVEPOINT active_record_2 SQL (0.2ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "63"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 201 Created in 3ms (Views: 1.0ms | ActiveRecord: 0.4ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------- PushType::Api::AssetsControllerTest::POST #create::with valid asset: test_0003_anonymous ----------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SELECT COUNT(*) FROM "push_type_assets" Processing by PushType::Api::AssetsController#create as JSON Parameters: {"asset"=>{"file"=>#, @original_filename="image.png", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"asset[file]\"; filename=\"image.png\"\r\nContent-Type: text/plain\r\nContent-Length: 2643\r\n">}}  (0.1ms) SAVEPOINT active_record_2 SQL (0.3ms) INSERT INTO "push_type_assets" ("file_uid", "file_name", "file_size", "file_ext", "mime_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["file_uid", "64"], ["file_name", "image.png"], ["file_size", 2643], ["file_ext", "png"], ["mime_type", "image/png"], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Rendering /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/_asset.json.jbuilder (0.2ms) Rendered /Users/aaron/dev/pushcode/push_type/api/app/views/push_type/api/assets/show.json.jbuilder (0.5ms) Completed 201 Created in 3ms (Views: 0.9ms | ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "push_type_assets"  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.0ms) BEGIN ----------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #position::reordering: test_0001_anonymous -----------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-138"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-138"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t6bc9bad70be1b01da18135884134dc2e SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["descendant_id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tdf9d138a4a470abf28df2e8e7b75a550  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.3ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-139"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-139"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t1aedcf51a83b8f4365dbfbb228a98b22 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "a8fbbc16-793a-47f5-814b-3aa5380a1845"], ["descendant_id", "a8fbbc16-793a-47f5-814b-3aa5380a1845"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a8fbbc16-793a-47f5-814b-3aa5380a1845"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "a8fbbc16-793a-47f5-814b-3aa5380a1845"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "a8fbbc16-793a-47f5-814b-3aa5380a1845"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t5eacc9654b9d1323002dd4927152500d  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-140"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-140"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS te6643bfd9b6cd6f1863b6b74d12c0115 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "4e887a47-0d59-41da-960c-cd49810a2031"], ["descendant_id", "4e887a47-0d59-41da-960c-cd49810a2031"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "4e887a47-0d59-41da-960c-cd49810a2031"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "4e887a47-0d59-41da-960c-cd49810a2031"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "4e887a47-0d59-41da-960c-cd49810a2031"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tba2f006ec3bf129a7bed14aa48ef4f8d  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-141"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-141"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t8dd9b81153a45c336f3e9238dd35632d SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "7d0b5a6d-9c57-48c3-a049-d2513f770cce"], ["descendant_id", "7d0b5a6d-9c57-48c3-a049-d2513f770cce"], ["generations", 0]]  (0.4ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "7d0b5a6d-9c57-48c3-a049-d2513f770cce"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.3ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "7d0b5a6d-9c57-48c3-a049-d2513f770cce"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "7d0b5a6d-9c57-48c3-a049-d2513f770cce"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t70151ed22c5a4ea684fbf8b62c8e5bfb  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-142"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-142"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t62cc2152bee0c714f541db799ab892e6 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "9210db0a-a698-44e4-8806-67375a7aa223"], ["descendant_id", "9210db0a-a698-44e4-8806-67375a7aa223"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "9210db0a-a698-44e4-8806-67375a7aa223"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "9210db0a-a698-44e4-8806-67375a7aa223"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "9210db0a-a698-44e4-8806-67375a7aa223"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tff783a26b7649af1ee3fe1beac7af0b9  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#position as JSON Parameters: {"prev"=>"0c84e378-0cf2-4b04-b33b-f4b83bc557d8", "id"=>"9210db0a-a698-44e4-8806-67375a7aa223", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "9210db0a-a698-44e4-8806-67375a7aa223"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-138"], ["id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tbb88351f8aa7dae766492e32b641519a  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-142"], ["id", "9210db0a-a698-44e4-8806-67375a7aa223"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["sort_order", 0], ["updated_at", 2017-04-07 12:50:17 UTC], ["id", "9210db0a-a698-44e4-8806-67375a7aa223"]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL AND "push_type_nodes"."sort_order" >= 0 ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "0c84e378-0cf2-4b04-b33b-f4b83bc557d8"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "9210db0a-a698-44e4-8806-67375a7aa223"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tfc8523f4d8f1e3924d82d0a62167c0e3 Completed 204 No Content in 9ms (ActiveRecord: 1.8ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------- PushType::Api::NodesControllerTest::POST #position::reordering: test_0002_anonymous -----------------------------------------------------------------------------------  (0.0ms) SAVEPOINT active_record_1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-143"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-143"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tfd1c018bf3b789b8be7ec4be7f4fbb6f SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "730c221c-de33-4826-b314-3643590b5b26"], ["descendant_id", "730c221c-de33-4826-b314-3643590b5b26"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "730c221c-de33-4826-b314-3643590b5b26"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "730c221c-de33-4826-b314-3643590b5b26"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "730c221c-de33-4826-b314-3643590b5b26"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS td08e15b4aef398b656b5d7d2a1a410c9  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-144"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-144"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t5754138329dbaccdaf5bf502eb5081c6 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "150fa18c-23bc-4f0a-ac54-6648039b2f9e"], ["descendant_id", "150fa18c-23bc-4f0a-ac54-6648039b2f9e"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "150fa18c-23bc-4f0a-ac54-6648039b2f9e"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "150fa18c-23bc-4f0a-ac54-6648039b2f9e"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "150fa18c-23bc-4f0a-ac54-6648039b2f9e"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t7d23d54107634dbdcc6e60b37d73ea54  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.0ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-145"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-145"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS td237523f0e93f67338d47c7691c640d5 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "81816b04-5262-4d22-aab4-c7e49a188b69"], ["descendant_id", "81816b04-5262-4d22-aab4-c7e49a188b69"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "81816b04-5262-4d22-aab4-c7e49a188b69"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "81816b04-5262-4d22-aab4-c7e49a188b69"], ["LIMIT", 1000]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "81816b04-5262-4d22-aab4-c7e49a188b69"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t243e85cd5a99220d725d8aa5514415c6  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-146"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-146"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS ta92037c4dd52e86556b13c26f4568b20 SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "a2056518-d629-471e-9c15-9ecd61c5bd4e"], ["descendant_id", "a2056518-d629-471e-9c15-9ecd61c5bd4e"], ["generations", 0]]  (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "a2056518-d629-471e-9c15-9ecd61c5bd4e"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "a2056518-d629-471e-9c15-9ecd61c5bd4e"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "a2056518-d629-471e-9c15-9ecd61c5bd4e"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS t8629a34b717cdbac5e872308115b7bf8  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND "push_type_nodes"."parent_id" IS NULL LIMIT $2 [["slug", "foo-bar-147"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "push_type_nodes" ("title", "slug", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["title", "Foo bar"], ["slug", "foo-bar-147"], ["status", 0], ["created_at", 2017-04-07 12:50:17 UTC], ["updated_at", 2017-04-07 12:50:17 UTC]]  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS t4b569ae36e6248f56d849fd796154a7b SQL (0.1ms) INSERT INTO "push_type_node_hierarchies" ("ancestor_id", "descendant_id", "generations") VALUES ($1, $2, $3) [["ancestor_id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"], ["descendant_id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"], ["generations", 0]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"], ["LIMIT", 1]] Scoped order and limit are ignored, it's forced to be batch order and batch size. PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY "push_type_nodes"."id" ASC LIMIT $2 [["parent_id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"], ["LIMIT", 1000]] PushType::Node Load (0.2ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."parent_id" = $1 ORDER BY sort_order [["parent_id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"]]  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS te433bad332c6a3fab5c4b27daeeb5c69  (0.1ms) RELEASE SAVEPOINT active_record_2 Processing by PushType::Api::NodesController#position as JSON Parameters: {"prev"=>"730c221c-de33-4826-b314-3643590b5b26", "id"=>"c8fc7cad-f32a-40a2-baa6-2ecb752dec91", "node"=>{}} PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "730c221c-de33-4826-b314-3643590b5b26"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.2ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-143"], ["id", "730c221c-de33-4826-b314-3643590b5b26"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_try_advisory_lock(1268756593,0) AS tf28f98178d986d3b2e1c3666eab1b04e  (0.1ms) SAVEPOINT active_record_2 PushType::Node Exists (0.1ms) SELECT 1 AS one FROM "push_type_nodes" WHERE "push_type_nodes"."slug" = $1 AND ("push_type_nodes"."id" != $2) AND "push_type_nodes"."parent_id" IS NULL LIMIT $3 [["slug", "foo-bar-147"], ["id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"], ["LIMIT", 1]] SQL (0.2ms) UPDATE "push_type_nodes" SET "sort_order" = $1, "updated_at" = $2 WHERE "push_type_nodes"."id" = $3 [["sort_order", 0], ["updated_at", 2017-04-07 12:50:17 UTC], ["id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"]]  (0.3ms) UPDATE "push_type_nodes" SET "sort_order" = t.seq + -1 FROM ( SELECT "id" AS id, row_number() OVER(ORDER BY sort_order) AS seq FROM "push_type_nodes" WHERE "parent_id" IS NULL AND "push_type_nodes"."sort_order" >= 0 ) AS t WHERE "push_type_nodes"."id" = t.id  PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "730c221c-de33-4826-b314-3643590b5b26"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "730c221c-de33-4826-b314-3643590b5b26"], ["LIMIT", 1]] PushType::Node Load (0.1ms) SELECT "push_type_nodes".* FROM "push_type_nodes" WHERE "push_type_nodes"."id" = $1 LIMIT $2 [["id", "c8fc7cad-f32a-40a2-baa6-2ecb752dec91"], ["LIMIT", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SELECT pg_advisory_unlock(1268756593,0) AS tf9a87de1e9ad1fe50b21eb5344275959 Completed 204 No Content in 9ms (ActiveRecord: 1.7ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK