Connecting to database specified by database.yml  (1.5ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml Connecting to database specified by database.yml  (2.9ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.2ms) rollback transaction  (0.0ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (6.6ms) begin transaction  (0.3ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.1ms) select sqlite_version(*)  (189.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)  (0.1ms) PRAGMA index_list("schema_migrations")  (132.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  Migrating to CreateDisclaimerDocuments (20121023125748)  (0.1ms) begin transaction  (2.1ms) CREATE TABLE "disclaimer_documents" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "header" text, "footer" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)   (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121023125748')  (172.4ms) commit transaction  (0.4ms) select sqlite_version(*)  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"   (0.1ms) PRAGMA index_list("disclaimer_documents") Connecting to database specified by database.yml  (6.1ms) begin transaction Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Disclaimer::Document Load (3.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (3.9ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (1.1ms) begin transaction  (1.6ms) rollback transaction Connecting to database specified by database.yml  (5.8ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (5.0ms) begin transaction Disclaimer::Document Load (5.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml Connecting to database specified by database.yml  (5.6ms) begin transaction Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Disclaimer::Document Load (5.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml Connecting to database specified by database.yml Connecting to database specified by database.yml  (6.4ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:41:06', '2012-10-23 13:41:06')  (205.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:42:31', '2012-10-23 13:42:31')  (157.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (6.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (7.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.3ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:46:10', '2012-10-23 13:46:10')  (217.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (3.4ms) Completed 200 OK in 41ms (Views: 40.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Completed 200 OK in 4ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:49:50', '2012-10-23 13:49:50')  (182.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (2.4ms) Completed 200 OK in 48ms (Views: 47.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.5ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:50:21', '2012-10-23 13:50:21')  (183.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (1.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:51:18', '2012-10-23 13:51:18')  (200.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:53:15', '2012-10-23 13:53:15')  (197.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (3.0ms) Completed 200 OK in 62ms (Views: 61.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.8ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:56:09', '2012-10-23 13:56:09')  (181.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (3.2ms) Completed 200 OK in 56ms (Views: 55.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (3.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:58:18', '2012-10-23 13:58:18')  (189.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (7.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (2.5ms) Completed 200 OK in 55ms (Views: 52.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 13:59:19', '2012-10-23 13:59:19')  (221.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (2.5ms) Completed 200 OK in 58ms (Views: 55.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:01:46', '2012-10-23 14:01:46')  (190.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (2.3ms) Completed 200 OK in 51ms (Views: 49.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:02:48', '2012-10-23 14:02:48')  (225.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/delete.html.erb within layouts/disclaimer/application (4.0ms) Completed 200 OK in 61ms (Views: 50.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 9ms (Views: 6.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:05:56', '2012-10-23 14:05:56')  (175.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 50ms (Views: 48.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 7ms (Views: 4.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:07:08', '2012-10-23 14:07:08')  (217.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 11ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 45ms (Views: 41.9ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.1ms)  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 6ms (Views: 4.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:10:54', '2012-10-23 14:10:54')  (270.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 43ms (Views: 40.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:11:52', '2012-10-23 14:11:52')  (176.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (25.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:11:52 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:11:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 71ms  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 6ms (Views: 2.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (10.0ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:13:17', '2012-10-23 14:13:17')  (228.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (5.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (24.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:13:18 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:13:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 31ms  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 27ms (Views: 21.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 7ms (Views: 5.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:13:52', '2012-10-23 14:13:52')  (184.1ms) commit transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (24.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:13:52 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:13:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 31ms (ActiveRecord: 24.5ms)  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 17ms (Views: 15.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 6ms (Views: 2.6ms | ActiveRecord: 2.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:14:22', '2012-10-23 14:14:22')  (280.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (32.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:14:23 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:14:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 38ms (ActiveRecord: 33.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 17ms (Views: 16.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 4ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (5.0ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:16:53', '2012-10-23 14:16:53')  (247.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (27.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:16:53 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:16:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 35ms (ActiveRecord: 27.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 18ms (Views: 16.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.0ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:17:50', '2012-10-23 14:17:50')  (238.1ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (25.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:17:51 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:17:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 30ms (ActiveRecord: 25.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 19ms (Views: 17.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Parameters: {"id"=>"1"} Completed 200 OK in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 5ms (Views: 3.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (4.5ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:18:16', '2012-10-23 14:18:16')  (201.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (24.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:18:17 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:18:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 29ms (ActiveRecord: 24.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 19ms (Views: 17.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 3.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 7ms (Views: 5.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.3ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:19:32', '2012-10-23 14:19:32')  (315.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (26.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:19:32 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:19:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 31ms (ActiveRecord: 26.3ms)  (0.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 18ms (Views: 16.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 35ms  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-23 14:19:32.997985' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 10ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (3.0ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:19:56', '2012-10-23 14:19:56')  (174.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (6.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (3.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (21.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:19:56 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:19:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 29ms (ActiveRecord: 21.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 25ms (Views: 23.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 38ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-23 14:19:56.991025' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 8ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (4.6ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 14:20:21', '2012-10-23 14:20:21')  (162.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (23.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 14:20:21 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 14:20:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 28ms (ActiveRecord: 23.8ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 24ms (Views: 22.4ms | ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 6ms (Views: 4.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (3.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 10ms (Views: 3.9ms | ActiveRecord: 3.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-23 14:20:21.740847' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 7ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:15:06', '2012-10-23 15:15:06')  (213.5ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (22.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 15:15:06 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 15:15:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 27ms (ActiveRecord: 22.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 21ms (Views: 19.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 45ms (Views: 43.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 5ms (Views: 1.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-23 15:15:06.697689' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 10ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:17:48', '2012-10-23 15:17:48')  (177.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (27.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 15:17:48 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 15:17:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 32ms (ActiveRecord: 27.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 21ms (Views: 19.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 41ms (Views: 39.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 7ms (Views: 5.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-23 15:17:48.473954' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 7ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.3ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:18:14', '2012-10-23 15:18:14')  (182.9ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (27.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 15:18:14 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 15:18:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 37ms (ActiveRecord: 27.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 21ms (Views: 19.6ms | ActiveRecord: 0.1ms)  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Completed 500 Internal Server Error in 1ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 37ms (Views: 34.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (4.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 8ms (Views: 3.0ms | ActiveRecord: 4.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (1.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-23 15:18:14.488409' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 8ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (4.0ms) begin transaction Fixture Delete (1.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:18:56', '2012-10-23 15:18:56')  (170.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (24.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 23 Oct 2012 15:18:57 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Tue, 23 Oct 2012 15:18:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 29ms (ActiveRecord: 24.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 29ms (Views: 27.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 3ms  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 37ms (Views: 35.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (2.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 7ms (Views: 4.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.2ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-23 15:18:57.426584' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 7ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (4.0ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:19:38', '2012-10-23 15:19:38')  (194.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (33.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:20:48', '2012-10-23 15:20:48')  (226.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 59ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.7ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:21:57', '2012-10-23 15:21:57')  (184.5ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 62ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.4ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:22:15', '2012-10-23 15:22:15')  (148.4ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:22:51', '2012-10-23 15:22:51')  (232.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:23:28', '2012-10-23 15:23:28')  (248.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Rendered text template (0.0ms) Completed 200 OK in 36ms (Views: 33.7ms | ActiveRecord: 0.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (4.0ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:24:42', '2012-10-23 15:24:42')  (195.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.9ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:26:41', '2012-10-23 15:26:41')  (171.1ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:28:21', '2012-10-23 15:28:21')  (229.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 6ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (4.3ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:28:58', '2012-10-23 15:28:58')  (191.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:29:31', '2012-10-23 15:29:31')  (175.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (1.7ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:29:56', '2012-10-23 15:29:56')  (200.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:30:18', '2012-10-23 15:30:18')  (208.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.7ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:31:31', '2012-10-23 15:31:31')  (180.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:31:57', '2012-10-23 15:31:57')  (176.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Redirected to http://test.host/disclaimer/ Completed 302 Found in 2ms (ActiveRecord: 0.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-23 15:32:11', '2012-10-23 15:32:11')  (228.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (2.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 07:39:12', '2012-10-24 07:39:12')  (422.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml Connecting to database specified by database.yml Connecting to database specified by database.yml  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  Migrating to CreateDisclaimerDocuments (20121023125748) Migrating to CreateSegments (20121024074240)  (0.1ms) select sqlite_version(*)  (0.0ms) begin transaction  (2.6ms) CREATE TABLE "disclaimer_segments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "body" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121024074240')  (216.1ms) commit transaction Migrating to CreateDocumentsSegments (20121024074416)  (0.1ms) begin transaction  (0.6ms) CREATE TABLE "disclaimer_documents_segments" ("document_id" integer, "segment_id" integer)  (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121024074416')  (202.6ms) commit transaction Migrating to CreateDisclaimerSegmentHolders (20121024080818)  (0.2ms) begin transaction  (8.1ms) CREATE TABLE "disclaimer_segment_holders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "document_id" integer, "segment_id" integer, "position" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121024080818')  (170.0ms) commit transaction  (1.0ms) select sqlite_version(*)  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  (0.1ms) PRAGMA index_list("disclaimer_documents")  (0.1ms) PRAGMA index_list("disclaimer_documents_segments")  (0.1ms) PRAGMA index_list("disclaimer_segment_holders")  (0.1ms) PRAGMA index_list("disclaimer_segments") Connecting to database specified by database.yml Connecting to database specified by database.yml  (3.5ms) begin transaction Fixture Delete (2.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 08:35:32', '2012-10-24 08:35:32') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 08:35:32', '2012-10-24 08:35:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 08:35:32', '2012-10-24 08:35:32', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 08:35:32', '2012-10-24 08:35:32') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 08:35:32', '2012-10-24 08:35:32')  (224.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.9ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.5ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:11:04', '2012-10-24 09:11:04') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:11:04', '2012-10-24 09:11:04', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:11:04', '2012-10-24 09:11:04', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:11:04', '2012-10-24 09:11:04') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:11:04', '2012-10-24 09:11:04')  (208.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (4.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (2.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:12:05', '2012-10-24 09:12:05') Fixture Delete (1.4ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (1.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:12:06', '2012-10-24 09:12:06', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:12:06', '2012-10-24 09:12:06', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:12:06', '2012-10-24 09:12:06') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:12:06', '2012-10-24 09:12:06')  (152.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (4.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.4ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:22:25', '2012-10-24 09:22:25') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:22:26', '2012-10-24 09:22:26', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:22:26', '2012-10-24 09:22:26', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:22:26', '2012-10-24 09:22:26') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:22:26', '2012-10-24 09:22:26')  (172.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position, position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (4.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:23:06', '2012-10-24 09:23:06') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:23:06', '2012-10-24 09:23:06', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:23:06', '2012-10-24 09:23:06', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:23:06', '2012-10-24 09:23:06') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:23:06', '2012-10-24 09:23:06')  (201.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position, position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:24:12', '2012-10-24 09:24:12') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:24:12', '2012-10-24 09:24:12', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:24:12', '2012-10-24 09:24:12', 298486374) Fixture Delete (1.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:24:12', '2012-10-24 09:24:12') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:24:12', '2012-10-24 09:24:12')  (145.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (3.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.4ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:24:35', '2012-10-24 09:24:35') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:24:35', '2012-10-24 09:24:35', 980190962) Fixture Insert (0.5ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:24:35', '2012-10-24 09:24:35', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:24:35', '2012-10-24 09:24:35') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:24:35', '2012-10-24 09:24:35')  (193.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (3.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 3.5ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"   (3.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (23.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml Connecting to database specified by database.yml  (2.5ms) begin transaction Fixture Delete (2.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:31:13', '2012-10-24 09:31:13') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:31:13', '2012-10-24 09:31:13', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:31:13', '2012-10-24 09:31:13', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:31:13', '2012-10-24 09:31:13') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:31:13', '2012-10-24 09:31:13')  (170.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 1.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (2.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:31:33', '2012-10-24 09:31:33') Fixture Delete (1.2ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:31:33', '2012-10-24 09:31:33', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:31:33', '2012-10-24 09:31:33', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:31:33', '2012-10-24 09:31:33') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:31:33', '2012-10-24 09:31:33')  (187.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:31:51', '2012-10-24 09:31:51') Fixture Delete (2.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:31:51', '2012-10-24 09:31:51', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:31:51', '2012-10-24 09:31:51', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:31:51', '2012-10-24 09:31:51') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:31:51', '2012-10-24 09:31:51')  (206.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.1ms)  (1.7ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.3ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:32:25', '2012-10-24 09:32:25') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:32:25', '2012-10-24 09:32:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:32:25', '2012-10-24 09:32:25', 298486374) Fixture Delete (1.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:32:25', '2012-10-24 09:32:25') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:32:25', '2012-10-24 09:32:25')  (265.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 1.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.9ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.5ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:34:48', '2012-10-24 09:34:48') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:34:48', '2012-10-24 09:34:48', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:34:48', '2012-10-24 09:34:48', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:34:48', '2012-10-24 09:34:48') Fixture Insert (0.5ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:34:48', '2012-10-24 09:34:48')  (199.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.9ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:35:23', '2012-10-24 09:35:23') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:35:23', '2012-10-24 09:35:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:35:23', '2012-10-24 09:35:23', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:35:23', '2012-10-24 09:35:23') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:35:23', '2012-10-24 09:35:23')  (195.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.9ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:35:24.349718' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.5ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:35:58', '2012-10-24 09:35:58') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:35:58', '2012-10-24 09:35:58', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:35:58', '2012-10-24 09:35:58', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:35:58', '2012-10-24 09:35:58') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:35:58', '2012-10-24 09:35:58')  (141.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (3.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:35:58.704916' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:36:13', '2012-10-24 09:36:13') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:36:13', '2012-10-24 09:36:13', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:36:13', '2012-10-24 09:36:13', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:36:13', '2012-10-24 09:36:13') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:36:13', '2012-10-24 09:36:13')  (167.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 2.6ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (3.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:36:13.819032' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.7ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:44:32', '2012-10-24 09:44:32') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:44:32', '2012-10-24 09:44:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:44:32', '2012-10-24 09:44:32', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:44:32', '2012-10-24 09:44:32') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:44:32', '2012-10-24 09:44:32')  (161.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:44:32.585557' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.5ms) rollback transaction Connecting to database specified by database.yml  (1.9ms) begin transaction Fixture Delete (2.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:54:42', '2012-10-24 09:54:42') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:54:42', '2012-10-24 09:54:42', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:54:42', '2012-10-24 09:54:42', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:54:42', '2012-10-24 09:54:42') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:54:42', '2012-10-24 09:54:42')  (184.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (1.9ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (3.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:54:42.885564' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:55:03', '2012-10-24 09:55:03') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:55:03', '2012-10-24 09:55:03', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:55:03', '2012-10-24 09:55:03', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:55:03', '2012-10-24 09:55:03') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:55:03', '2012-10-24 09:55:03')  (142.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (3.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:55:04.181626' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.6ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (7.1ms) begin transaction Fixture Delete (4.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:55:39', '2012-10-24 09:55:39') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:55:40', '2012-10-24 09:55:40', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:55:40', '2012-10-24 09:55:40', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:55:40', '2012-10-24 09:55:40') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:55:40', '2012-10-24 09:55:40')  (193.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (4.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (4.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:55:40.447856' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (2.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:56:02', '2012-10-24 09:56:02') Fixture Delete (1.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:56:02', '2012-10-24 09:56:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:56:02', '2012-10-24 09:56:02', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:56:02', '2012-10-24 09:56:02') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:56:02', '2012-10-24 09:56:02')  (177.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (5.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (2.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:56:02.911899' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:56:52', '2012-10-24 09:56:52') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:56:52', '2012-10-24 09:56:52', 980190962) Fixture Insert (0.6ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:56:52', '2012-10-24 09:56:52', 298486374) Fixture Delete (1.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:56:52', '2012-10-24 09:56:52') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:56:52', '2012-10-24 09:56:52')  (186.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 1.8ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (1.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (10.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:56:53.231403' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.9ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:57:12', '2012-10-24 09:57:12') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:57:12', '2012-10-24 09:57:12', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:57:12', '2012-10-24 09:57:12', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:57:12', '2012-10-24 09:57:12') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:57:12', '2012-10-24 09:57:12')  (147.6ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (1.0ms) SAVEPOINT active_record_1 SQL (4.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 5.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (1.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:57:13.139720' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (6.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (21.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:57:13.191512' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.6ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:58:54', '2012-10-24 09:58:54') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:58:54', '2012-10-24 09:58:54', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:58:54', '2012-10-24 09:58:54', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:58:54', '2012-10-24 09:58:54') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:58:54', '2012-10-24 09:58:54')  (139.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:58:54.537390' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 09:59:23', '2012-10-24 09:59:23') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 09:59:23', '2012-10-24 09:59:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 09:59:23', '2012-10-24 09:59:23', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 09:59:23', '2012-10-24 09:59:23') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 09:59:23', '2012-10-24 09:59:23')  (131.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (3.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 4.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:59:24.001677' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 09:59:24.026985' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (2.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:04:14', '2012-10-24 10:04:14') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:04:14', '2012-10-24 10:04:14', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:04:14', '2012-10-24 10:04:14', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:04:14', '2012-10-24 10:04:14') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:04:14', '2012-10-24 10:04:14')  (168.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:04:14.646906' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (21.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:04:14.666854' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:06:56', '2012-10-24 10:06:56') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:06:56', '2012-10-24 10:06:56', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:06:56', '2012-10-24 10:06:56', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:06:56', '2012-10-24 10:06:56') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:06:56', '2012-10-24 10:06:56')  (96.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:06:56.585184' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:11:45', '2012-10-24 10:11:45') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:11:45', '2012-10-24 10:11:45', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:11:45', '2012-10-24 10:11:45', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:11:45', '2012-10-24 10:11:45') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:11:45', '2012-10-24 10:11:45')  (160.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:11:46.227220' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (8.3ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.5ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (3.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:12:11', '2012-10-24 10:12:11') Fixture Delete (1.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:12:11', '2012-10-24 10:12:11', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:12:11', '2012-10-24 10:12:11', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:12:11', '2012-10-24 10:12:11') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:12:11', '2012-10-24 10:12:11')  (204.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (4.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:12:12.157545' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (11.8ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:15:14', '2012-10-24 10:15:14') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:15:14', '2012-10-24 10:15:14', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:15:14', '2012-10-24 10:15:14', 298486374) Fixture Delete (1.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:15:14', '2012-10-24 10:15:14') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:15:14', '2012-10-24 10:15:14')  (184.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:15:14.826389' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.8ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:15:36', '2012-10-24 10:15:36') Fixture Delete (1.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:15:36', '2012-10-24 10:15:36', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:15:36', '2012-10-24 10:15:36', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:15:36', '2012-10-24 10:15:36') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:15:36', '2012-10-24 10:15:36')  (178.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:15:36.966006' WHERE "disclaimer_segment_holders"."id" = 980190962  (2.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.0ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:18:09', '2012-10-24 10:18:09') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:18:09', '2012-10-24 10:18:09', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:18:09', '2012-10-24 10:18:09', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:18:09', '2012-10-24 10:18:09') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:18:09', '2012-10-24 10:18:09')  (179.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:18:09.965931' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (25.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:18:09.990865' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (2.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:24:36', '2012-10-24 10:24:36') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:24:36', '2012-10-24 10:24:36', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:24:36', '2012-10-24 10:24:36', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:24:36', '2012-10-24 10:24:36') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:24:36', '2012-10-24 10:24:36')  (163.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.6ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents"   (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:24:36.542377' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:24:36.603156' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (3.8ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (6.0ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:26:15', '2012-10-24 10:26:15') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:26:15', '2012-10-24 10:26:15', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:26:15', '2012-10-24 10:26:15', 298486374) Fixture Delete (2.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:26:15', '2012-10-24 10:26:15') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:26:15', '2012-10-24 10:26:15')  (204.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:26:16.002685' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (23.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:26:16.063760' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (3.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:28:21', '2012-10-24 10:28:21') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:28:21', '2012-10-24 10:28:21', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:28:21', '2012-10-24 10:28:21', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:28:21', '2012-10-24 10:28:21') Fixture Insert (0.4ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:28:21', '2012-10-24 10:28:21')  (208.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (1.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 2.4ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (8.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:28:21.765980' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (23.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:28:21.818144' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (11.7ms) begin transaction Fixture Delete (2.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:30:44', '2012-10-24 10:30:44') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:30:44', '2012-10-24 10:30:44', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:30:44', '2012-10-24 10:30:44', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:30:44', '2012-10-24 10:30:44') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:30:44', '2012-10-24 10:30:44')  (205.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 10:30:45 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 10:30:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:30:45.276002' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (3.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:30:45.316959' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (11.1ms) begin transaction Fixture Delete (2.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.4ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:31:18', '2012-10-24 10:31:18') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:31:18', '2012-10-24 10:31:18', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:31:18', '2012-10-24 10:31:18', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:31:18', '2012-10-24 10:31:18') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:31:18', '2012-10-24 10:31:18')  (195.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 10:31:18 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 10:31:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (1.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:31:18.935961' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:31:18.977736' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.2ms) rollback transaction Connecting to database specified by database.yml  (10.5ms) begin transaction Fixture Delete (2.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.4ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 10:31:42', '2012-10-24 10:31:42') Fixture Delete (2.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 10:31:42', '2012-10-24 10:31:42', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 10:31:42', '2012-10-24 10:31:42', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 10:31:42', '2012-10-24 10:31:42') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 10:31:42', '2012-10-24 10:31:42')  (159.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.3ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 10:31:43 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 10:31:43 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:31:43.269821' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 10:31:43.313114' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 11:11:49', '2012-10-24 11:11:49') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 11:11:49', '2012-10-24 11:11:49', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 11:11:49', '2012-10-24 11:11:49', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 11:11:49', '2012-10-24 11:11:49') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 11:11:49', '2012-10-24 11:11:49')  (187.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 11:11:50 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 11:11:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:11:50.077696' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:11:50.104619' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#delete as HTML Completed 200 OK in 55ms (Views: 55.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#show as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 11:12:20', '2012-10-24 11:12:20') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 11:12:21', '2012-10-24 11:12:21', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 11:12:21', '2012-10-24 11:12:21', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 11:12:21', '2012-10-24 11:12:21') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 11:12:21', '2012-10-24 11:12:21')  (173.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 11:12:21 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 11:12:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:12:21.503918' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:12:21.532413' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#delete as HTML Completed 200 OK in 46ms (Views: 46.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#show as HTML Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 11:13:37', '2012-10-24 11:13:37') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 11:13:37', '2012-10-24 11:13:37', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 11:13:37', '2012-10-24 11:13:37', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 11:13:37', '2012-10-24 11:13:37') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 11:13:37', '2012-10-24 11:13:37')  (150.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (2.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 11:13:38 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 11:13:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (5.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.0ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:13:38.365140' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:13:38.400647' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#delete as HTML Completed 200 OK in 45ms (Views: 44.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#show as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 11:14:05', '2012-10-24 11:14:05') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 11:14:05', '2012-10-24 11:14:05', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 11:14:05', '2012-10-24 11:14:05', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 11:14:05', '2012-10-24 11:14:05') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 11:14:05', '2012-10-24 11:14:05')  (139.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 11:14:06 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 11:14:06 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (1.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:14:06.217118' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.8ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (2.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:14:06.250591' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Processing by Disclaimer::SegmentsController#delete as HTML Completed 200 OK in 50ms (Views: 49.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Processing by Disclaimer::SegmentsController#show as HTML Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.7ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 11:14:38', '2012-10-24 11:14:38') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 11:14:38', '2012-10-24 11:14:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 11:14:38', '2012-10-24 11:14:38', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 11:14:38', '2012-10-24 11:14:38') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 11:14:38', '2012-10-24 11:14:38')  (162.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 11:14:38 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 11:14:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 12ms (ActiveRecord: 4.9ms)  (2.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 71ms (Views: 69.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 17ms (Views: 15.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 8ms (Views: 5.8ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (4.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 11:14:38.992026' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 11ms (ActiveRecord: 4.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 11:14:39 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 11:14:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (4.1ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:14:39.106705' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 11:14:39.142175' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#delete as HTML Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by Disclaimer::SegmentsController#show as HTML Completed 200 OK in 4ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (3.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 12:51:12', '2012-10-24 12:51:12') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (1.6ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 12:51:12', '2012-10-24 12:51:12', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 12:51:12', '2012-10-24 12:51:12', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 12:51:12', '2012-10-24 12:51:12') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 12:51:12', '2012-10-24 12:51:12')  (186.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 12:51:13 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 12:51:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 9ms (ActiveRecord: 3.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 52ms (Views: 49.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 20ms (Views: 18.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 1.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (3.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 12:51:13.299579' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 10ms (ActiveRecord: 3.3ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 12:51:13 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 12:51:13 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 12:51:13.416672' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (2.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 12:51:13.444263' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment"}} Completed 500 Internal Server Error in 54ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (4.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Completed 500 Internal Server Error in 2ms  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.5ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 12:52:13', '2012-10-24 12:52:13') Fixture Delete (1.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 12:52:13', '2012-10-24 12:52:13', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 12:52:13', '2012-10-24 12:52:13', 298486374) Fixture Delete (1.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (2.2ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 12:52:13', '2012-10-24 12:52:13') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 12:52:13', '2012-10-24 12:52:13')  (192.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 12:52:13 UTC +00:00], ["footer", nil], ["header", nil], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 12:52:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 10ms (ActiveRecord: 4.5ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 56ms (Views: 54.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 17ms (Views: 13.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 6ms (Views: 3.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 11ms (Views: 5.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 12:52:13.951369' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 12ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.7ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 12:52:14 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 12:52:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 12:52:14.061249' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (2.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 12:52:14.089032' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 12:52:14 UTC +00:00], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 12:52:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 12ms (ActiveRecord: 3.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.7ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 10ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 7ms (Views: 3.8ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Completed 200 OK in 4ms (Views: 2.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 8ms (Views: 1.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 12:52:14.242443' WHERE "disclaimer_segments"."id" = 1  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 8ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:16:57', '2012-10-24 13:16:57') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:16:57', '2012-10-24 13:16:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:16:57', '2012-10-24 13:16:57', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 13:16:57', '2012-10-24 13:16:57') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 13:16:57', '2012-10-24 13:16:57')  (185.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 8ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 54ms (Views: 52.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (5.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 5.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 20ms (Views: 14.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 4ms  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:16:57 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:16:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:16:57.823337' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:16:57.867849' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 13:16:57 UTC +00:00], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 13:16:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 10ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 12ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 14ms (Views: 11.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 12.3ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 46ms (Views: 44.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (2.5ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:16:58.066516' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 8ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.7ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.8ms) INSERT INTO "disclaimer_documents" ("id", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:20:27', '2012-10-24 13:20:27') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:20:27', '2012-10-24 13:20:27', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:20:27', '2012-10-24 13:20:27', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (1, 'MyString', 'MyText', '2012-10-24 13:20:27', '2012-10-24 13:20:27') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "title", "body", "created_at", "updated_at") VALUES (2, 'MyString', 'MyText', '2012-10-24 13:20:27', '2012-10-24 13:20:27')  (163.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 52ms (Views: 50.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (4.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 4.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 19ms (Views: 17.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 9ms (Views: 8.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 10ms (Views: 8.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:20:28 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:20:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:20:28.296878' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:20:28.325053' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 13:20:28 UTC +00:00], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 13:20:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 11ms (Views: 8.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 18ms (Views: 12.8ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (2.0ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 44ms (Views: 41.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.6ms) SAVEPOINT active_record_1  (3.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:20:28.528565' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 9ms (ActiveRecord: 4.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.7ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.4ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (1.0ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (2.1ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.7ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.2ms) begin transaction Fixture Delete (2.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (3.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.6ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (2.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (2.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.6ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (4.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (1.4ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.8ms) begin transaction Fixture Delete (5.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction  (0.1ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.9ms) rollback transaction  (0.2ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.6ms) rollback transaction  (0.2ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39') SQLite3::SQLException: table disclaimer_documents has no column named name: INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:21:39', '2012-10-24 13:21:39')  (0.5ms) rollback transaction Connecting to database specified by database.yml  (0.1ms) select sqlite_version(*)  (181.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)  (0.1ms) PRAGMA index_list("schema_migrations")  (199.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.2ms) SELECT version FROM "schema_migrations"  (172.3ms) INSERT INTO "schema_migrations" (version) VALUES ('0')  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  Connecting to database specified by database.yml  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  Migrating to CreateDisclaimerDocuments (20121023125748)  (0.1ms) select sqlite_version(*)  (0.1ms) begin transaction  (5.5ms) CREATE TABLE "disclaimer_documents" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "name" varchar(255), "header" text, "footer" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (1.9ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121023125748')  (218.8ms) commit transaction Migrating to CreateSegments (20121024074240)  (0.1ms) begin transaction  (0.5ms) CREATE TABLE "disclaimer_segments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "title" varchar(255), "body" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121024074240')  (184.4ms) commit transaction Migrating to CreateDisclaimerSegmentHolders (20121024080818)  (0.1ms) begin transaction  (0.5ms) CREATE TABLE "disclaimer_segment_holders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "document_id" integer, "segment_id" integer, "position" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121024080818')  (175.2ms) commit transaction  (0.3ms) select sqlite_version(*)  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"  (0.0ms) PRAGMA index_list("disclaimer_documents")  (0.0ms) PRAGMA index_list("disclaimer_segment_holders")  (0.0ms) PRAGMA index_list("disclaimer_segments") Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:22:26', '2012-10-24 13:22:26') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:22:26', '2012-10-24 13:22:26', 980190962) Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:22:26', '2012-10-24 13:22:26', 298486374) Fixture Delete (1.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 13:22:26', '2012-10-24 13:22:26') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 13:22:26', '2012-10-24 13:22:26')  (194.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 12ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 46ms (Views: 44.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 15ms (Views: 9.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 3.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 1.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.2ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 13:22:26.605166' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 13ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:22:26 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:22:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:22:26.728328' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (3.0ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:22:26.758499' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment"}}  (2.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 10ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 11ms (Views: 8.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 11ms (Views: 6.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 14.3ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 44ms (Views: 42.1ms | ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:22:26.961170' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 9ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (2.7ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:24:18', '2012-10-24 13:24:18') Fixture Delete (1.4ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:24:18', '2012-10-24 13:24:18', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:24:18', '2012-10-24 13:24:18', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 13:24:18', '2012-10-24 13:24:18') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 13:24:18', '2012-10-24 13:24:18')  (198.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 54ms (Views: 49.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 16ms (Views: 14.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (4.8ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 13:24:18.869111' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 12ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (3.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:24:18 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:24:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:24:18.994213' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:24:19.022687' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 17ms (Views: 10.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (2.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 3.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 8ms (Views: 5.6ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.1ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 10ms (Views: 9.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 44ms (Views: 42.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:24:19.226552' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 11ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:24:47', '2012-10-24 13:24:47') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (2.7ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:24:47', '2012-10-24 13:24:47', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:24:47', '2012-10-24 13:24:47', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 13:24:47', '2012-10-24 13:24:47') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 13:24:47', '2012-10-24 13:24:47')  (182.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:24:48 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 13:24:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 9ms (ActiveRecord: 4.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 54ms (Views: 52.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 18ms (Views: 16.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (5.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 8ms (Views: 1.9ms | ActiveRecord: 5.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 13:24:48.387617' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 9ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:24:48 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:24:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:24:48.506083' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:24:48.533234' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 13:24:48 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 13:24:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 11ms (ActiveRecord: 3.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 10ms (Views: 8.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 22ms (Views: 17.7ms | ActiveRecord: 3.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 38ms (Views: 35.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:24:48.755127' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 9ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:25:25', '2012-10-24 13:25:25') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:25:25', '2012-10-24 13:25:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:25:25', '2012-10-24 13:25:25', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 13:25:25', '2012-10-24 13:25:25') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 13:25:25', '2012-10-24 13:25:25')  (282.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:25:26 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 13:25:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 11ms (ActiveRecord: 5.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 47ms (Views: 45.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 16ms (Views: 14.4ms | ActiveRecord: 0.1ms)  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 1.7ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (4.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 13:25:26.428069' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 13ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:25:26 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:25:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:25:26.553814' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:25:26.587194' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.4ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 13:25:26 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 13:25:26 UTC +00:00]]  (2.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 12ms (ActiveRecord: 4.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 13ms (Views: 11.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (2.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 11ms (Views: 7.1ms | ActiveRecord: 2.6ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 13.9ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 53ms (Views: 51.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:25:26.802190' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 16ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (2.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.6ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:49:28', '2012-10-24 13:49:28') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:49:28', '2012-10-24 13:49:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:49:28', '2012-10-24 13:49:28', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 13:49:28', '2012-10-24 13:49:28') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 13:49:28', '2012-10-24 13:49:28')  (211.8ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:49:28 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 13:49:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 12ms (ActiveRecord: 4.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 52ms (Views: 50.9ms | ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 17ms (Views: 15.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (3.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 13:49:29.134557' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 10ms (ActiveRecord: 3.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:49:29 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:49:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:49:29.241811' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:49:29.268783' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 13:49:29 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 13:49:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 10ms (ActiveRecord: 2.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 15ms (Views: 8.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 11ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 10ms (Views: 5.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 18ms (Views: 15.6ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 43ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:49:29.471010' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 8ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (5.1ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:50:24', '2012-10-24 13:50:24') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:50:24', '2012-10-24 13:50:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:50:24', '2012-10-24 13:50:24', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 13:50:24', '2012-10-24 13:50:24') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 13:50:24', '2012-10-24 13:50:24')  (262.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (1.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:50:24 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 13:50:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 13ms (ActiveRecord: 5.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 57ms (Views: 54.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 15ms (Views: 12.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Completed 200 OK in 4ms (Views: 3.0ms | ActiveRecord: 0.1ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 13:50:24.720742' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 10ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:50:24 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:50:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:50:24.829999' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.8ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:50:24.860881' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 13:50:24 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 13:50:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 9ms (ActiveRecord: 4.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 11ms (Views: 8.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 9ms (Views: 7.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 17ms (Views: 14.3ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 500 Internal Server Error in 50ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (2.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:50:25.059045' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 7ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 13:51:39', '2012-10-24 13:51:39') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 13:51:39', '2012-10-24 13:51:39', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 13:51:39', '2012-10-24 13:51:39', 298486374) Fixture Delete (1.4ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 13:51:39', '2012-10-24 13:51:39') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 13:51:39', '2012-10-24 13:51:39')  (235.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:51:39 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 13:51:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/2 Completed 302 Found in 10ms (ActiveRecord: 3.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 49ms (Views: 47.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (3.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 4.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 18ms (Views: 16.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Completed 200 OK in 4ms (Views: 2.4ms | ActiveRecord: 0.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 13:51:39.770106' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/1 Completed 302 Found in 13ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 13:51:39 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 13:51:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:51:39.878388' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 13:51:39.907977' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 13:51:39 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 13:51:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/3 Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 11ms (Views: 9.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 11ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Completed 200 OK in 7ms (Views: 5.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 12.8ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]] Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 43ms (Views: 41.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 13:51:40.106211' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/1 Completed 302 Found in 9ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:37:14', '2012-10-24 14:37:14') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:37:14', '2012-10-24 14:37:14', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:37:14', '2012-10-24 14:37:14', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:37:14', '2012-10-24 14:37:14') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:37:14', '2012-10-24 14:37:14')  (187.6ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:37:14.955061' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:37:15 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:37:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 10ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 50ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 49ms (Views: 46.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 15ms (Views: 14.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 7ms  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:37:15 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:37:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:37:15.419508' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:37:15.450138' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:37:15 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:37:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 7ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 8ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 14ms (Views: 11.4ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.9ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:38:41', '2012-10-24 14:38:41') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:38:41', '2012-10-24 14:38:41', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:38:41', '2012-10-24 14:38:41', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:38:41', '2012-10-24 14:38:41') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:38:41', '2012-10-24 14:38:41')  (202.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:38:41.564379' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::SegmentHolder Load (2.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:38:41 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:38:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 11ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 46ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (1.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 60ms (Views: 57.4ms | ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 13ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 7ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 2 LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (1.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:38:41 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:38:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 2 LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 2 LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:38:41.970119' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 2 LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = 2 LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:38:42.000657' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.4ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:38:42 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:38:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 7ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 7ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 7ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.3ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (9.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (7.0ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:39:24', '2012-10-24 14:39:24') Fixture Delete (1.2ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:39:24', '2012-10-24 14:39:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:39:24', '2012-10-24 14:39:24', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:39:24', '2012-10-24 14:39:24') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:39:24', '2012-10-24 14:39:24')  (195.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:39:24.930313' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:39:25 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:39:25 UTC +00:00]]  (7.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 13ms (ActiveRecord: 8.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 61ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 62ms (Views: 53.5ms | ActiveRecord: 0.2ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 13ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 8ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:39:25 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:39:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:39:25.400072' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:39:25.430919' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:39:25 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:39:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 8ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 10ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 7ms  (2.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 9ms (Views: 8.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"1", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (9.8ms) begin transaction Fixture Delete (2.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:40:33', '2012-10-24 14:40:33') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:40:33', '2012-10-24 14:40:33', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:40:33', '2012-10-24 14:40:33', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:40:33', '2012-10-24 14:40:33') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:40:33', '2012-10-24 14:40:33')  (196.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:40:33.838618' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:40:33 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:40:33 UTC +00:00]]  (3.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 12ms (ActiveRecord: 6.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 58ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 50ms (Views: 48.8ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 13ms (Views: 12.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"1"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 8ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"1", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = '1' LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:40:34 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:40:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:40:34.305978' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:40:34.337745' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:40:34 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:40:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 10ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 3.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 6.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.7ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (8.5ms) Completed 200 OK in 29ms (Views: 27.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:40:34.531607' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 4ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.0ms) begin transaction Fixture Delete (9.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:41:04', '2012-10-24 14:41:04') Fixture Delete (0.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:41:04', '2012-10-24 14:41:04', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:41:04', '2012-10-24 14:41:04', 298486374) Fixture Delete (0.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:41:04', '2012-10-24 14:41:04') Fixture Insert (3.7ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:41:04', '2012-10-24 14:41:04')  (161.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:41:04.613726' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:41:04 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:41:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 47.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 54ms (Views: 51.8ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (2.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:41:04.949692' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:41:04 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:41:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:41:05.026346' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (7.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:41:05.059852' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (6.8ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:41:05 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:41:05 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 12ms (ActiveRecord: 7.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 19.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (4.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 18.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 40ms (Views: 38.3ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 73ms (Views: 71.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:41:05.367594' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 12ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.0ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:41:58', '2012-10-24 14:41:58') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:41:58', '2012-10-24 14:41:58', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:41:58', '2012-10-24 14:41:58', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:41:58', '2012-10-24 14:41:58') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:41:58', '2012-10-24 14:41:58')  (166.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_documents" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:41:59.002377' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:41:59 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:41:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 8ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 93ms (Views: 91.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 37ms (Views: 36.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (4.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 100ms (Views: 89.8ms | ActiveRecord: 4.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 8ms (Views: 6.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:41:59.473341' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:41:59 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:41:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (2.6ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:41:59.518291' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:41:59.547987' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:41:59.578904' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.6ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.7ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:41:59 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:41:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 9ms (ActiveRecord: 2.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 8.9ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 12.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 17ms (Views: 14.9ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 45ms (Views: 42.1ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:41:59.774039' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 17ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (10.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:44:06', '2012-10-24 14:44:06') Fixture Delete (0.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:44:07', '2012-10-24 14:44:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:44:07', '2012-10-24 14:44:07', 298486374) Fixture Delete (0.4ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:44:07', '2012-10-24 14:44:07') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:44:07', '2012-10-24 14:44:07')  (105.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.9ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 44.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 14.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 55ms (Views: 53.4ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 3.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (2.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (1.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:44:07 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:44:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:44:07.567901' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:44:07.595869' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 14ms (Views: 11.9ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 77ms (Views: 66.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 14ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.5ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:45:04', '2012-10-24 14:45:04') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:45:04', '2012-10-24 14:45:04', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:45:04', '2012-10-24 14:45:04', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:45:04', '2012-10-24 14:45:04') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:45:04', '2012-10-24 14:45:04')  (187.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 73ms (Views: 63.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 13.6ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 54ms (Views: 52.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:45:05 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:45:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:45:05.259043' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:45:05.286658' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 3ms  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 9.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 13ms (Views: 11.5ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (4.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.0ms) Completed 200 OK in 39ms (Views: 37.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 3ms  (0.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:46:01', '2012-10-24 14:46:01') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:46:01', '2012-10-24 14:46:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:46:01', '2012-10-24 14:46:01', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:46:01', '2012-10-24 14:46:01') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:46:01', '2012-10-24 14:46:01')  (223.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 50ms (Views: 47.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 16.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 50ms (Views: 48.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 8ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:46:02 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:46:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (6.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:46:02.108872' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.8ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:46:02.141492' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:46:02.177315' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (7.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:46:02 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:46:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 10ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 10.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 9.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.5ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 49ms (Views: 46.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:46:02.409537' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 18ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:46:45', '2012-10-24 14:46:45') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:46:46', '2012-10-24 14:46:46', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:46:46', '2012-10-24 14:46:46', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:46:46', '2012-10-24 14:46:46') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:46:46', '2012-10-24 14:46:46')  (156.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:46:46.234246' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:46:46 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:46:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 10ms (ActiveRecord: 5.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 98ms (Views: 96.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (8.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 28ms (Views: 18.0ms | ActiveRecord: 8.3ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 53ms (Views: 50.7ms | ActiveRecord: 0.9ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:46:46.641254' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:46:46 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:46:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:46:46.689104' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:46:46.719135' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:46:46.746717' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:46:46 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:46:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 9ms (ActiveRecord: 3.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 7.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (3.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 14.1ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 46ms (Views: 44.1ms | ActiveRecord: 0.2ms)  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:46:46.951201' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:47:07', '2012-10-24 14:47:07') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:47:07', '2012-10-24 14:47:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:47:07', '2012-10-24 14:47:07', 298486374) Fixture Delete (1.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:47:07', '2012-10-24 14:47:07') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:47:07', '2012-10-24 14:47:07')  (204.6ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:47:08.074936' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:47:08 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:47:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new%20document Completed 302 Found in 11ms (ActiveRecord: 0.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 88ms (Views: 86.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 17ms (Views: 15.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 49ms (Views: 47.0ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 7ms (Views: 5.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (3.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:47:08.476563' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 4.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:47:08 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:47:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:47:08.520958' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:47:08.550134' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:47:08.584696' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:47:08 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:47:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 7ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 6.9ms | ActiveRecord: 0.2ms)  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 10.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 18ms (Views: 16.4ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 67ms (Views: 64.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:47:08.806985' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (4.3ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:49:30', '2012-10-24 14:49:30') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:49:30', '2012-10-24 14:49:30', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:49:30', '2012-10-24 14:49:30', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:49:30', '2012-10-24 14:49:30') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:49:30', '2012-10-24 14:49:30')  (187.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 14:49:30.938439' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 10ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 90ms (Views: 79.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (4.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 29ms (Views: 23.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 55ms (Views: 53.2ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:49:31.344646' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_segments" SET "name" = 'This is a Name', "updated_at" = '2012-10-24 14:49:31.392244' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:49:31.422448' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:49:31.451850' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00], ["name", "new segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:49:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new%20segment Completed 302 Found in 9ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 6.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 12.8ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 39ms (Views: 36.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:49:31.639373' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.3ms) begin transaction Fixture Delete (3.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:49:58', '2012-10-24 14:49:58') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:49:58', '2012-10-24 14:49:58', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:49:58', '2012-10-24 14:49:58', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:49:58', '2012-10-24 14:49:58') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:49:58', '2012-10-24 14:49:58')  (138.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 14:49:58.501187' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:58 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:49:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 10ms (ActiveRecord: 3.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 61ms (Views: 56.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 16.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 57ms (Views: 52.2ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 2.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:49:58.885570' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 0.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:49:58 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:49:58 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 14:49:58.943253' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:49:58.968719' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (10.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:49:59.004828' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (2.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (5.0ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:49:59 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:49:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 16ms (ActiveRecord: 5.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 19.0ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 12ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 6.7ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 12.2ms | ActiveRecord: 2.9ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 49ms (Views: 44.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:49:59.226738' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (2.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:54:55', '2012-10-24 14:54:55') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:54:55', '2012-10-24 14:54:55', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:54:55', '2012-10-24 14:54:55', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:54:55', '2012-10-24 14:54:55') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:54:55', '2012-10-24 14:54:55')  (209.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.2ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 14:54:56.173037' WHERE "disclaimer_documents"."id" = 1  (4.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:54:56 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 9ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 45.5ms | ActiveRecord: 0.2ms)  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 18.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 54ms (Views: 51.3ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (3.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:54:56.554422' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 3.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:54:56 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 14:54:56.601321' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:54:56.628906' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:54:56.657562' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:54:56 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 6.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 12.6ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 55ms (Views: 52.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:54:56.888032' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (6.6ms) rollback transaction  (4.3ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (5.1ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 14:55:44', '2012-10-24 14:55:44') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 14:55:44', '2012-10-24 14:55:44', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 14:55:44', '2012-10-24 14:55:44', 298486374) Fixture Delete (1.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 14:55:44', '2012-10-24 14:55:44') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 14:55:44', '2012-10-24 14:55:44')  (206.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 14:55:44.462823' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:55:44 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 14:55:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 53ms (Views: 51.0ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (2.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 17ms (Views: 14.7ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 57ms (Views: 55.2ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 3.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 14:55:44.820055' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 14:55:44 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 14:55:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (3.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 14:55:44.867286' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:55:44.896042' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 14:55:44.925524' WHERE "disclaimer_segment_holders"."id" = 980190962  (3.9ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 14:55:44 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 14:55:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 12.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 3ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 30ms (Views: 17.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 30ms (Views: 28.3ms | ActiveRecord: 1.3ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 62ms (Views: 52.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 14:55:45.192849' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (3.7ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:01:42', '2012-10-24 15:01:42') Fixture Delete (1.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:01:42', '2012-10-24 15:01:42', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:01:42', '2012-10-24 15:01:42', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:01:42', '2012-10-24 15:01:42') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:01:42', '2012-10-24 15:01:42')  (200.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (4.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:01:43.187308' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:01:43 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:01:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 13ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 46.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 16.8ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 50ms (Views: 47.4ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:01:43.558858' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:01:43 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:01:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (4.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:01:43.600898' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (3.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:01:43.637944' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:01:43.668893' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:01:43 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:01:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 4.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.2ms)  (3.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 15ms (ActiveRecord: 5.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 21.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 30ms (Views: 28.2ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 17ms (Views: 16.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 65ms (Views: 63.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (4.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:01:43.927351' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 10ms (ActiveRecord: 4.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (6.0ms) rollback transaction  (0.1ms) begin transaction  (6.1ms) rollback transaction Connecting to database specified by database.yml  (2.2ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.5ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:02:35', '2012-10-24 15:02:35') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:02:35', '2012-10-24 15:02:35', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:02:35', '2012-10-24 15:02:35', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:02:35', '2012-10-24 15:02:35') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:02:35', '2012-10-24 15:02:35')  (138.5ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:02:35.600242' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:02:35 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:02:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 46ms (Views: 43.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.5ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 5.6ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 17ms (Views: 14.6ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 50ms (Views: 48.6ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 6ms (Views: 4.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:02:36.009438' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:02:36 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:02:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (5.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:02:36.053430' WHERE "disclaimer_segments"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:02:36.086130' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:02:36.120970' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:02:36 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:02:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 11ms (ActiveRecord: 0.8ms)  (2.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 12.8ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 46ms (Views: 44.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (3.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:02:36.321951' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:03:27', '2012-10-24 15:03:27') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:03:27', '2012-10-24 15:03:27', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:03:27', '2012-10-24 15:03:27', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:03:27', '2012-10-24 15:03:27') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:03:27', '2012-10-24 15:03:27')  (164.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (4.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:03:27.582062' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:03:27 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:03:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 11ms (ActiveRecord: 6.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 47ms (Views: 45.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 17.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 60ms (Views: 57.9ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 2.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:03:27.955687' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:03:27 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:03:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (3.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:03:28.002211' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:03:28.030270' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:03:28.061076' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.3ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:03:28 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:03:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.3ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (3.3ms) Completed 200 OK in 45ms (Views: 42.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:03:28.268108' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.5ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:04:07', '2012-10-24 15:04:07') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:04:07', '2012-10-24 15:04:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:04:07', '2012-10-24 15:04:07', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:04:07', '2012-10-24 15:04:07') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:04:07', '2012-10-24 15:04:07')  (194.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:04:07.449465' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:04:07 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:04:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 45.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 17ms (Views: 14.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 54ms (Views: 52.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:04:07.833507' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:04:07 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:04:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (3.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:04:07.886212' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:04:07.915864' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (2.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (4.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:04:07.945854' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_documents" SET "title" = '', "updated_at" = '2012-10-24 15:04:07.962748' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:04:07 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:04:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 9ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.2ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 18ms (Views: 15.7ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 73ms (Views: 70.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:04:08.186652' WHERE "disclaimer_segments"."id" = 1  (4.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 4.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.2ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:08:40', '2012-10-24 15:08:40') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:08:40', '2012-10-24 15:08:40', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:08:40', '2012-10-24 15:08:40', 298486374) Fixture Delete (1.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:08:40', '2012-10-24 15:08:40') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:08:40', '2012-10-24 15:08:40')  (226.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:08:41.091454' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:08:41 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:08:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 45.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 14.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 54ms (Views: 51.6ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 3.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (4.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:08:41.509066' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 4.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:08:41 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:08:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (3.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:08:41.558812' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:08:41.589528' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:08:41.622235' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.3ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:08:41 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:08:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 4.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 78ms (Views: 70.0ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:08:41.865972' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 12ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (2.7ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.5ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:10:02', '2012-10-24 15:10:02') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:10:02', '2012-10-24 15:10:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:10:02', '2012-10-24 15:10:02', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:10:02', '2012-10-24 15:10:02') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:10:02', '2012-10-24 15:10:02')  (342.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (5.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:10:02.996876' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:10:03 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:10:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 4.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 54ms (Views: 52.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 18ms (Views: 15.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 64ms (Views: 53.7ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 2.9ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:10:03.424209' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:10:03 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:10:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:10:03.474364' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (3.0ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:10:03.506343' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (5.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:10:03.537232' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_documents" SET "title" = '', "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:10:03.553743' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (7.4ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:10:03 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:10:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 22ms (ActiveRecord: 8.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 18ms (Views: 16.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 4ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 10.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 13.4ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.1ms) Completed 200 OK in 60ms (Views: 57.5ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:10:03.805335' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 12ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.9ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:10:24', '2012-10-24 15:10:24') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:10:24', '2012-10-24 15:10:24', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:10:24', '2012-10-24 15:10:24', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:10:24', '2012-10-24 15:10:24') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:10:24', '2012-10-24 15:10:24')  (174.8ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:10:24.670490' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:10:24 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:10:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 9ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 50ms (Views: 47.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (8.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 9.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 33ms (Views: 27.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 89ms (Views: 88.0ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 7ms (Views: 3.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:10:25.070529' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:10:25 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:10:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:10:25.115351' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:10:25.143381' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:10:25.175225' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "title" = '', "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:10:25.187891' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:10:25 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:10:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 11ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 6.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 8.4ms | ActiveRecord: 0.2ms)  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 14ms (Views: 11.7ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 42ms (Views: 40.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:10:25.384831' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.9ms) begin transaction Fixture Delete (2.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:11:21', '2012-10-24 15:11:21') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:11:21', '2012-10-24 15:11:21', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:11:21', '2012-10-24 15:11:21', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:11:21', '2012-10-24 15:11:21') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:11:21', '2012-10-24 15:11:21')  (235.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:11:21.905715' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:11:22 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:11:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 9ms (ActiveRecord: 4.9ms)  (5.6ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 81ms (Views: 75.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 13.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 52ms (Views: 50.5ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 3.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (2.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:11:22.327865' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:11:22 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:11:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:11:22.370902' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:11:22.404164' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:11:22.440939' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:11:22 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:11:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 6.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 32ms (Views: 30.4ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 20ms (Views: 19.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 47ms (Views: 45.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:11:22.672308' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (2.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:12:28', '2012-10-24 15:12:28') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:12:28', '2012-10-24 15:12:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:12:28', '2012-10-24 15:12:28', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:12:28', '2012-10-24 15:12:28') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:12:28', '2012-10-24 15:12:28')  (179.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (11.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:12:28.597844' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (1.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:12:28 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:12:28 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 2.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 45.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 53ms (Views: 51.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 8ms (Views: 6.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 3.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:12:28.952377' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (8.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:12:28 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:12:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:12:29.013086' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (8.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:12:29.043090' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:12:29.077355' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (8.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:12:29 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:12:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 18ms (Views: 12.1ms | ActiveRecord: 0.7ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 46ms (Views: 44.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:12:29.306619' WHERE "disclaimer_segments"."id" = 1  (7.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 18ms (ActiveRecord: 8.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:13:10', '2012-10-24 15:13:10') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:13:10', '2012-10-24 15:13:10', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:13:10', '2012-10-24 15:13:10', 298486374) Fixture Delete (1.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:13:10', '2012-10-24 15:13:10') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:13:10', '2012-10-24 15:13:10')  (151.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:13:11.002932' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:13:11 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:13:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 10ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 50ms (Views: 47.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 53ms (Views: 51.8ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 6ms (Views: 4.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:13:11.415561' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:13:11 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:13:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:13:11.460078' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:13:11.493202' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:13:11.519376' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:13:11 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:13:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 7.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 13.9ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.9ms) Completed 200 OK in 45ms (Views: 42.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:13:11.717526' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (4.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:13:39', '2012-10-24 15:13:39') Fixture Delete (0.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:13:39', '2012-10-24 15:13:39', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:13:39', '2012-10-24 15:13:39', 298486374) Fixture Delete (0.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:13:39', '2012-10-24 15:13:39') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:13:39', '2012-10-24 15:13:39')  (167.4ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:13:39.923885' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:13:40 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:13:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 45.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 4.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 17.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 57ms (Views: 53.7ms | ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 2.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:13:40.272517' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:13:40 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:13:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (4.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:13:40.320670' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:13:40.365621' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (5.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:13:40.400395' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:13:40 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:13:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 23.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (4.8ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 5.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 17ms (Views: 15.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 13ms (Views: 10.7ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 47ms (Views: 42.8ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:13:40.634446' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.3ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-24 15:14:43', '2012-10-24 15:14:43') Fixture Delete (0.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-24 15:14:43', '2012-10-24 15:14:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-24 15:14:43', '2012-10-24 15:14:43', 298486374) Fixture Delete (5.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-24 15:14:43', '2012-10-24 15:14:43') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-24 15:14:43', '2012-10-24 15:14:43')  (147.8ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (3.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:14:43.704421' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:14:43 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Wed, 24 Oct 2012 15:14:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 10ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 46.3ms | ActiveRecord: 0.2ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 17.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 53ms (Views: 51.3ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 5ms (Views: 2.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-24 15:14:44.048588' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 5.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Wed, 24 Oct 2012 15:14:44 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Wed, 24 Oct 2012 15:14:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-24 15:14:44.097111' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:14:44.124756' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-24 15:14:44.153559' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Wed, 24 Oct 2012 15:14:44 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Wed, 24 Oct 2012 15:14:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 9ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 4.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 32ms (Views: 28.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 25ms (Views: 23.5ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 10ms (Views: 9.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (5.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.4ms) Completed 200 OK in 84ms (Views: 77.0ms | ActiveRecord: 5.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-24 15:14:44.432737' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.1ms) begin transaction Fixture Delete (3.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 14:56:13', '2012-10-25 14:56:13') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 14:56:13', '2012-10-25 14:56:13', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 14:56:13', '2012-10-25 14:56:13', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 14:56:13', '2012-10-25 14:56:13') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 14:56:13', '2012-10-25 14:56:13')  (143.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:56:13.632367' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 30ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:56:13 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 14:56:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 23.5ms | ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (1.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 39ms (Views: 35.8ms | ActiveRecord: 1.9ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 18ms (Views: 16.9ms | ActiveRecord: 0.7ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 11.1ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 14:56:14.007122' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 5ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 500 Internal Server Error in 2ms  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:56:14 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 14:56:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:56:14.083057' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:56:14.102833' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:56:14.125778' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (8.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 14:56:14 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 14:56:14 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (19.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 25ms (ActiveRecord: 20.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 0.7ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 8.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (3.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 14:56:14.324714' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 3.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (2.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 14:57:37', '2012-10-25 14:57:37') Fixture Delete (3.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 14:57:38', '2012-10-25 14:57:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 14:57:38', '2012-10-25 14:57:38', 298486374) Fixture Delete (2.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 14:57:38', '2012-10-25 14:57:38') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 14:57:38', '2012-10-25 14:57:38')  (186.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:57:38.322535' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 51ms (ActiveRecord: 1.5ms) Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 1.7ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 46ms (Views: 43.9ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.7ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 24ms (Views: 21.8ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 10.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 39ms (Views: 38.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 14ms (Views: 12.4ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 14:57:38.737419' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.4ms) Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:57:38.780321' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:57:38.807426' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:57:38.829761' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 14:57:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.1ms)  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 14ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 12.3ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.3ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 12ms (Views: 10.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 14:57:38.983938' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.7ms) begin transaction Fixture Delete (1.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 14:58:28', '2012-10-25 14:58:28') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 14:58:28', '2012-10-25 14:58:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 14:58:28', '2012-10-25 14:58:28', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 14:58:28', '2012-10-25 14:58:28') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 14:58:28', '2012-10-25 14:58:28')  (260.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:58:28.837167' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 57ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 53ms (Views: 51.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 24ms (Views: 22.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 40ms (Views: 12.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 7ms (Views: 5.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 14:58:29.240149' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (2.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:58:29.285039' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:58:29.309345' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (8.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:58:29.343772' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 14:58:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 7ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 6.9ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.1ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (1.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (1.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 15ms (Views: 13.4ms | ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 14:58:29.494287' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.5ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.0ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 14:59:54', '2012-10-25 14:59:54') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 14:59:54', '2012-10-25 14:59:54', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 14:59:54', '2012-10-25 14:59:54', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 14:59:54', '2012-10-25 14:59:54') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 14:59:54', '2012-10-25 14:59:54')  (203.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:59:54.842943' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:59:54 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 14:59:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 18ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 9ms (ActiveRecord: 2.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 51ms (Views: 49.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 27ms (Views: 25.3ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (3.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 15ms (Views: 9.1ms | ActiveRecord: 3.9ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 37ms (Views: 35.6ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 14:59:55.257575' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 3.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 3.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 14:59:55.321127' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:59:55.344198' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 14:59:55.371751' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.8ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 14:59:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 9ms (ActiveRecord: 3.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 13.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 2.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 9.2ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 18ms (Views: 15.6ms | ActiveRecord: 0.8ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 14:59:55.536280' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:00:18', '2012-10-25 15:00:18') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:00:18', '2012-10-25 15:00:18', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:00:18', '2012-10-25 15:00:18', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:00:18', '2012-10-25 15:00:18') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:00:18', '2012-10-25 15:00:18')  (269.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:00:19.021117' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 44.4ms | ActiveRecord: 2.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 23ms (Views: 21.6ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 18ms (Views: 16.5ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 33ms (Views: 29.6ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:00:19.401467' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (2.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:00:19.451222' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:00:19.474327' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:00:19.494869' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:00:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 12.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 12.6ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.6ms) Completed 200 OK in 19ms (Views: 15.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:00:19.657496' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 5ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:00:40', '2012-10-25 15:00:40') Fixture Delete (1.2ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:00:40', '2012-10-25 15:00:40', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:00:40', '2012-10-25 15:00:40', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:00:40', '2012-10-25 15:00:40') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:00:40', '2012-10-25 15:00:40')  (180.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:00:40.511610' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.9ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:00:40 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:00:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 9ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 52ms (Views: 50.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 29ms (Views: 26.5ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 9.2ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 9.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.1ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:00:40.861844' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:00:40 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:00:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:00:40.937512' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:00:40.956857' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:00:40.981064' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.9ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:00:41 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:00:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 6.9ms | ActiveRecord: 0.4ms)  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.6ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (1.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 5.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.4ms) Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:00:41.127106' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.0ms) begin transaction Fixture Delete (2.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:01:00', '2012-10-25 15:01:00') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:01:00', '2012-10-25 15:01:00', 980190962) Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:01:00', '2012-10-25 15:01:00', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:01:00', '2012-10-25 15:01:00') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:01:00', '2012-10-25 15:01:00')  (260.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (3.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:01:01.095618' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:01:01 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:01:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 51ms (Views: 49.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 22ms (Views: 19.5ms | ActiveRecord: 0.6ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.6ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 15ms (Views: 14.0ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:01:01.444581' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:01:01 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:01:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:01:01.508970' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:01:01.528204' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:01:01.549567' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:01:01 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:01:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.7ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:01:01.693443' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 5ms (ActiveRecord: 1.4ms)  (1.0ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:01:19', '2012-10-25 15:01:19') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:01:19', '2012-10-25 15:01:19', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:01:19', '2012-10-25 15:01:19', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:01:19', '2012-10-25 15:01:19') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:01:19', '2012-10-25 15:01:19')  (239.1ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:01:19.769267' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:01:19 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:01:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:01:19 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:01:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (1.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 46.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 25ms (Views: 22.9ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.1ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 42ms (Views: 40.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 7.8ms | ActiveRecord: 0.4ms)  (1.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:01:20.179190' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:01:20 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:01:20 UTC +00:00]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:01:20.226668' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:01:20.254617' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:01:20.274989' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:01:20 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:01:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 9.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.0ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 12ms (Views: 9.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:01:20.421483' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:02:53', '2012-10-25 15:02:53') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:02:53', '2012-10-25 15:02:53', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:02:53', '2012-10-25 15:02:53', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:02:53', '2012-10-25 15:02:53') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:02:53', '2012-10-25 15:02:53')  (163.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:02:53.520920' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 11ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 47ms (Views: 44.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 24ms (Views: 21.6ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 38ms (Views: 37.6ms | ActiveRecord: 0.4ms)  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (1.7ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:02:53.941384' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 3.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:02:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:02:53.983239' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:02:54.007600' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:02:54.031025' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:02:54 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:02:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.8ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 6.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 14ms (Views: 10.5ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 12ms (Views: 10.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:02:54.170644' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:05:21', '2012-10-25 15:05:21') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:05:21', '2012-10-25 15:05:21', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:05:21', '2012-10-25 15:05:21', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:05:21', '2012-10-25 15:05:21') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:05:21', '2012-10-25 15:05:21')  (190.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:05:21.363732' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 59ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 23ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 24.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 45ms (Views: 43.3ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 16ms (Views: 11.9ms | ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 13ms (Views: 12.0ms | ActiveRecord: 0.4ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 5.1ms | ActiveRecord: 0.5ms)  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:05:21.854027' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:05:21.900900' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:05:21.926703' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:05:21.947968' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:05:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 11.1ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 13ms (Views: 11.6ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 13ms (Views: 11.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:05:22.100831' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.6ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:07:58', '2012-10-25 15:07:58') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:07:59', '2012-10-25 15:07:59', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:07:59', '2012-10-25 15:07:59', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:07:59', '2012-10-25 15:07:59') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:07:59', '2012-10-25 15:07:59')  (148.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:07:59.214203' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 55ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 27ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 2.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.6ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 22.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 48ms (Views: 45.8ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.6ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 13ms (Views: 11.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 7ms (Views: 5.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:07:59.708653' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:07:59.756697' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (3.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:07:59.780008' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:07:59.801462' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:07:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 9.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 8ms (Views: 6.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 13ms (Views: 11.8ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 17ms (Views: 13.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (3.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:07:59.945619' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 3.7ms)  (1.9ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (2.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:09:32', '2012-10-25 15:09:32') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:09:32', '2012-10-25 15:09:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:09:32', '2012-10-25 15:09:32', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:09:32', '2012-10-25 15:09:32') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:09:32', '2012-10-25 15:09:32')  (196.1ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:09:32.772923' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 63ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:09:32 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:09:32 UTC +00:00]] Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:09:32 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:09:32 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 22ms (ActiveRecord: 3.4ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (23.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 43ms (ActiveRecord: 28.9ms) Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#agree as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 23.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.9ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 52ms (Views: 48.0ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 18ms (Views: 14.7ms | ActiveRecord: 2.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.3ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:09:33.286385' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:09:33.331882' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (8.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:09:33.366942' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:09:33.392840' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:09:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 4.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (2.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 11.0ms | ActiveRecord: 3.2ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:09:33.541434' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.2ms) begin transaction Fixture Delete (1.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:10:27', '2012-10-25 15:10:27') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:10:27', '2012-10-25 15:10:27', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:10:27', '2012-10-25 15:10:27', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:10:27', '2012-10-25 15:10:27') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:10:27', '2012-10-25 15:10:27')  (178.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:10:27.886518' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 61ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 3.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 3.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (25.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 29.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#agree as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 54ms (Views: 51.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 23ms (Views: 21.0ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 14ms (Views: 11.6ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 16ms (Views: 10.8ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 7.7ms | ActiveRecord: 0.4ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:10:28.419889' WHERE "disclaimer_documents"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:10:28.470138' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:10:28.495887' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.1ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:10:28.517037' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:10:28 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 7.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (1.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 14.7ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 47ms (Views: 45.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:10:28.699081' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (1.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:10:54', '2012-10-25 15:10:54') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:10:54', '2012-10-25 15:10:54', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:10:54', '2012-10-25 15:10:54', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:10:54', '2012-10-25 15:10:54') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:10:54', '2012-10-25 15:10:54')  (227.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (8.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:10:54.732710' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 56ms (ActiveRecord: 2.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (22.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:10:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 24.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#agree as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:55 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:10:55 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 20.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 49ms (Views: 45.1ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 8.3ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:10:55.213085' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:10:55 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:10:55 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:10:55.260605' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:10:55.284544' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:10:55.308469' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:10:55 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:10:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 7ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (1.2ms) SAVEPOINT active_record_1 SQL (1.8ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 11.1ms | ActiveRecord: 1.3ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 11ms (Views: 9.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:10:55.459555' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (1.5ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:11:20', '2012-10-25 15:11:20') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:11:20', '2012-10-25 15:11:20', 980190962) Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:11:20', '2012-10-25 15:11:20', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:11:20', '2012-10-25 15:11:20') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:11:20', '2012-10-25 15:11:20')  (191.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:11:20.820253' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (4.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 48ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#agree as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 20.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 52ms (Views: 49.5ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.8ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 13ms (Views: 12.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 7ms (Views: 5.5ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:11:21.316404' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 7.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:11:21.368524' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:11:21.391601' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:11:21.414630' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (1.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:11:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 14.0ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 11ms (Views: 8.1ms | ActiveRecord: 0.2ms)  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:11:21.564099' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.5ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-25 15:14:28', '2012-10-25 15:14:28') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-25 15:14:28', '2012-10-25 15:14:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-25 15:14:28', '2012-10-25 15:14:28', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-25 15:14:28', '2012-10-25 15:14:28') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-25 15:14:28', '2012-10-25 15:14:28')  (229.8ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:14:28.868670' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 2.9ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 59ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 21.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (1.6ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 48ms (Views: 45.3ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 10.0ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 10.2ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-25 15:14:29.365483' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 4.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-25 15:14:29.411306' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:14:29.432673' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-25 15:14:29.460364' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 25 Oct 2012 15:14:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (1.4ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 10.6ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 13.8ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 10ms (Views: 8.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (10.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-25 15:14:29.619737' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 13ms (ActiveRecord: 10.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (4.9ms) begin transaction  (0.0ms) rollback transaction Connecting to database specified by database.yml  (8.4ms) begin transaction Fixture Delete (2.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:23:09', '2012-10-26 08:23:09') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:23:09', '2012-10-26 08:23:09', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:23:09', '2012-10-26 08:23:09', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:23:09', '2012-10-26 08:23:09') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:23:09', '2012-10-26 08:23:09')  (154.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:23:09.973185' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 69ms (ActiveRecord: 8.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00]] Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 2.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 9ms (ActiveRecord: 2.9ms)  (6.7ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 60ms (Views: 54.4ms | ActiveRecord: 3.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 34ms (Views: 32.1ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.2ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (21.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 40ms (Views: 17.3ms | ActiveRecord: 22.0ms)  (6.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 10.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:23:10.645214' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 4.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:23:10.693336' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (6.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:23:10.729195' WHERE "disclaimer_segment_holders"."id" = 980190962  (2.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:23:10.754072' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:23:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 7ms (ActiveRecord: 2.4ms)  (2.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 12.4ms | ActiveRecord: 0.2ms)  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (2.5ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 15ms (ActiveRecord: 4.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 15ms (Views: 13.2ms | ActiveRecord: 0.8ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 14ms (Views: 12.7ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:23:10.944667' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.4ms) rollback transaction Connecting to database specified by database.yml  (19.0ms) begin transaction Fixture Delete (6.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:34:24', '2012-10-26 08:34:24') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:34:25', '2012-10-26 08:34:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:34:25', '2012-10-26 08:34:25', 298486374) Fixture Delete (13.4ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:34:25', '2012-10-26 08:34:25') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:34:25', '2012-10-26 08:34:25')  (224.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SAVEPOINT active_record_1  (7.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:34:25.585051' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) rollback transaction  (2.6ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (8.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (19.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 317ms (ActiveRecord: 20.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 8.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (7.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:34:26 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:34:26 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:34:26 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:34:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 126ms (ActiveRecord: 16.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (11.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 56ms (ActiveRecord: 15.7ms) Disclaimer::Document Load (4.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 52ms (ActiveRecord: 10.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:34:27 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:34:27 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:34:27 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:34:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 77ms (ActiveRecord: 8.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (2.7ms) SAVEPOINT active_record_1 SQL (5.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:34:27 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:34:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 34ms (ActiveRecord: 8.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 316ms (Views: 304.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (22.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 45ms (ActiveRecord: 23.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (2.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (1.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 139ms (Views: 132.4ms | ActiveRecord: 3.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 52ms (Views: 35.2ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 59ms (Views: 57.4ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 51ms (Views: 45.3ms | ActiveRecord: 0.4ms)  (3.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (5.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:34:28.219189' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 53ms (ActiveRecord: 10.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (10.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 11.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:34:28 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:34:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (9.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:34:28.526675' WHERE "disclaimer_segments"."id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1  (5.5ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (4.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (5.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:34:28.682972' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (8.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (6.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (13.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (7.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (6.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:34:29.001122' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (8.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (20.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:34:29 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:34:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 46ms (ActiveRecord: 20.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (5.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 45ms (Views: 30.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (6.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.8ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 33ms (ActiveRecord: 10.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 31ms (Views: 26.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 78ms (Views: 63.9ms | ActiveRecord: 1.9ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 24ms (Views: 23.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (6.2ms) Completed 200 OK in 80ms (Views: 71.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (18.6ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:34:29.871281' WHERE "disclaimer_segments"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 46ms (ActiveRecord: 19.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.0ms) begin transaction Fixture Delete (5.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (4.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:52:08', '2012-10-26 08:52:08') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:52:08', '2012-10-26 08:52:08', 980190962) Fixture Insert (0.9ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:52:08', '2012-10-26 08:52:08', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.5ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:52:08', '2012-10-26 08:52:08') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:52:08', '2012-10-26 08:52:08')  (198.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:52:09.063936' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (8.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (10.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 10.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 72ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00]] Disclaimer::SegmentHolder Load (4.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 96ms (ActiveRecord: 15.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 6.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 10.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (4.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 60ms (ActiveRecord: 8.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:52:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 25ms (ActiveRecord: 5.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 161ms (Views: 153.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (7.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 23ms (ActiveRecord: 7.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (2.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (5.9ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 109ms (Views: 96.8ms | ActiveRecord: 6.4ms)  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 46ms (Views: 42.8ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (1.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 39ms (Views: 28.5ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 50ms (Views: 23.8ms | ActiveRecord: 1.7ms)  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:52:10.587815' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 6.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 5.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (7.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:52:10 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:52:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (3.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (5.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:52:10.770599' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.0ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (4.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:52:10.866614' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (3.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (6.0ms) rollback transaction  (2.5ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.1ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:52:10.955688' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (12.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:52:11 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:52:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 32ms (ActiveRecord: 12.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 40ms (Views: 31.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 12ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 14.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (8.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 20ms (Views: 15.0ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (9.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 12ms (Views: 8.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (2.5ms) Completed 200 OK in 56ms (Views: 50.6ms | ActiveRecord: 2.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (4.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (10.7ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:52:11.508212' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 53ms (ActiveRecord: 15.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Completed 200 OK in 13ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.2ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:53:45', '2012-10-26 08:53:45') Fixture Delete (1.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:53:45', '2012-10-26 08:53:45', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:53:45', '2012-10-26 08:53:45', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.6ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:53:45', '2012-10-26 08:53:45') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:53:45', '2012-10-26 08:53:45')  (185.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:53:45.533147' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 133ms (ActiveRecord: 8.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (6.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (4.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 46ms (ActiveRecord: 18.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (5.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 147ms (ActiveRecord: 6.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 38ms (ActiveRecord: 7.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 61ms (ActiveRecord: 7.7ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (11.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:53:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 33ms (ActiveRecord: 11.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (5.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 168ms (Views: 155.2ms | ActiveRecord: 5.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 18ms (ActiveRecord: 6.4ms)  (1.6ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.9ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 106ms (Views: 96.8ms | ActiveRecord: 1.4ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (3.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 27ms (Views: 20.4ms | ActiveRecord: 3.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 58ms (Views: 57.1ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 38ms (Views: 32.5ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (3.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:53:47.297037' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 15.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 9.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (3.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:53:47 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:53:47 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (2.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:53:47.474160' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (12.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:53:47.581439' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:53:47.666849' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (8.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:53:47 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:53:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 14ms (ActiveRecord: 8.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 39ms (Views: 28.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.8ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.8ms) SAVEPOINT active_record_1 SQL (4.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 25ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (8.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 58ms (Views: 44.3ms | ActiveRecord: 8.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 60ms (Views: 52.6ms | ActiveRecord: 0.4ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 23ms (Views: 22.6ms | ActiveRecord: 0.0ms)  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 43ms (Views: 38.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.4ms) SAVEPOINT active_record_1  (10.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:53:48.269844' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 35ms (ActiveRecord: 10.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.5ms) rollback transaction  (0.1ms) begin transaction  (2.5ms) rollback transaction  (0.2ms) begin transaction Processing by SampleController#index as HTML Completed 200 OK in 128ms (Views: 26.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:57:32', '2012-10-26 08:57:32') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:57:32', '2012-10-26 08:57:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:57:32', '2012-10-26 08:57:32', 298486374) Fixture Delete (3.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:57:32', '2012-10-26 08:57:32') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:57:32', '2012-10-26 08:57:32')  (213.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:57:32.368621' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.9ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 94ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 3.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 4.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:57:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:57:33 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:57:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 17ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 87ms (Views: 83.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.6ms) rollback transaction  (2.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 42ms (Views: 35.8ms | ActiveRecord: 1.0ms)  (0.3ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (1.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 23ms (Views: 17.9ms | ActiveRecord: 1.6ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 23ms (Views: 19.6ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 18ms (Views: 13.5ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:57:33.540624' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 18ms (ActiveRecord: 4.5ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:57:33 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:57:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:57:33.675179' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (1.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:57:33.756892' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:57:33.834600' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:57:33 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:57:33 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 13.4ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 10ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 14.6ms | ActiveRecord: 0.3ms)  (0.3ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Segment Load (5.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 25ms (Views: 20.0ms | ActiveRecord: 0.8ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (2.7ms) Completed 200 OK in 26ms (Views: 22.2ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (4.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:57:34.303621' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 14ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.2ms) begin transaction Processing by SampleController#index as HTML Completed 200 OK in 10ms (Views: 9.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.7ms) begin transaction Fixture Delete (2.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:58:30', '2012-10-26 08:58:30') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:58:30', '2012-10-26 08:58:30', 980190962) Fixture Insert (0.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:58:30', '2012-10-26 08:58:30', 298486374) Fixture Delete (1.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.5ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:58:30', '2012-10-26 08:58:30') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:58:30', '2012-10-26 08:58:30')  (270.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:58:30.747869' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (14.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 0.9ms)  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 279ms (ActiveRecord: 9.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 33ms (ActiveRecord: 6.5ms) Disclaimer::Document Load (8.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:58:31 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:58:31 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:58:31 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:58:31 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 224ms (ActiveRecord: 11.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.8ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 10.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (4.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:58:32 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:58:32 UTC +00:00]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:58:32 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:58:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 8.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:58:32 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:58:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 23ms (ActiveRecord: 5.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 173ms (Views: 167.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 47ms (ActiveRecord: 6.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (8.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 81ms (Views: 60.2ms | ActiveRecord: 8.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 48ms (Views: 40.4ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (4.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 50ms (Views: 48.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 25ms (Views: 16.5ms | ActiveRecord: 5.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.8ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:58:32.889855' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 9.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 5.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (4.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:58:33 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:58:33 UTC +00:00]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.6ms) SAVEPOINT active_record_1  (4.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:58:33.079016' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (6.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:58:33.215028' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (2.0ms) rollback transaction  (5.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (4.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:58:33.329115' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:58:33 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:58:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 24ms (ActiveRecord: 6.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (5.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 64ms (Views: 57.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (3.3ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 22ms (ActiveRecord: 8.1ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 27ms (Views: 20.9ms | ActiveRecord: 3.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 76ms (Views: 43.7ms | ActiveRecord: 2.1ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 13ms (Views: 12.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (6.7ms) Completed 200 OK in 60ms (Views: 57.8ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.5ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:58:33.972035' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 25ms (ActiveRecord: 5.4ms)  (2.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Completed 200 OK in 135ms (Views: 23.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.4ms) begin transaction Fixture Delete (8.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.6ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:59:03', '2012-10-26 08:59:03') Fixture Delete (1.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:59:03', '2012-10-26 08:59:03', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:59:03', '2012-10-26 08:59:03', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:59:03', '2012-10-26 08:59:03') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:59:03', '2012-10-26 08:59:03')  (290.0ms) commit transaction  (0.8ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:59:04.212278' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 2.0ms)  (2.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (6.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 125ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 3.7ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (8.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 88ms (ActiveRecord: 9.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:59:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 22ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (8.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:05 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:59:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 27ms (ActiveRecord: 8.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (13.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 227ms (Views: 223.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (6.8ms) SAVEPOINT active_record_1 SQL (5.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 37ms (ActiveRecord: 12.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 91ms (Views: 81.2ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 36ms (Views: 33.6ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (22.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 46ms (Views: 22.1ms | ActiveRecord: 23.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 36ms (Views: 28.1ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:59:05.777264' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 5.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 28ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:05 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:59:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (14.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (6.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:59:05.965544' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:59:06.053391' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:59:06.146452' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (11.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (7.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (18.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:59:06 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:59:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 38ms (ActiveRecord: 18.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 36ms (Views: 19.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 25ms (ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 23.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 42ms (Views: 33.6ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 31ms (Views: 30.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 57ms (Views: 50.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:59:06.752933' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 43ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Completed 200 OK in 148ms (Views: 16.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.9ms) begin transaction Fixture Delete (1.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 08:59:19', '2012-10-26 08:59:19') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 08:59:19', '2012-10-26 08:59:19', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 08:59:19', '2012-10-26 08:59:19', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 08:59:19', '2012-10-26 08:59:19') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 08:59:19', '2012-10-26 08:59:19')  (258.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:59:19.881246' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 114ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 3.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 3.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 08:59:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 16ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 105ms (Views: 101.0ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 44ms (Views: 39.1ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 24ms (Views: 19.0ms | ActiveRecord: 1.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.3ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 34ms (Views: 32.3ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 16ms (Views: 13.3ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 08:59:21.208573' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 3.3ms)  (2.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 08:59:21 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 08:59:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (2.7ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 08:59:21.371809' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:59:21.473493' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (4.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (3.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 08:59:21.563650' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 08:59:21 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 08:59:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 3.4ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 22.0ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 12ms (ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.6ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 16.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 34ms (Views: 28.4ms | ActiveRecord: 2.0ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 13ms (Views: 12.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (4.6ms) Completed 200 OK in 37ms (Views: 29.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 08:59:22.098771' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 14ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.6ms) begin transaction  (0.9ms) rollback transaction  (0.8ms) begin transaction Processing by SampleController#index as HTML Completed 200 OK in 10ms (Views: 9.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Connecting to database specified by database.yml  (1.6ms) begin transaction Fixture Delete (13.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 09:04:11', '2012-10-26 09:04:11') Fixture Delete (4.2ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 09:04:11', '2012-10-26 09:04:11', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 09:04:11', '2012-10-26 09:04:11', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 09:04:11', '2012-10-26 09:04:11') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 09:04:11', '2012-10-26 09:04:11')  (210.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:04:11.855917' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (1.8ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 122ms (ActiveRecord: 6.7ms) Disclaimer::Document Load (9.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 6.0ms) Disclaimer::Document Load (4.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (4.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 155ms (ActiveRecord: 3.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 4.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (1.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 18ms (ActiveRecord: 7.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 63ms (ActiveRecord: 10.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (12.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 09:04:12 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 38ms (ActiveRecord: 12.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 149ms (Views: 141.6ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (5.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 28ms (ActiveRecord: 4.0ms)  (7.0ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 75ms (Views: 68.7ms | ActiveRecord: 0.7ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (4.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 34ms (Views: 27.1ms | ActiveRecord: 4.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (3.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 67ms (Views: 63.0ms | ActiveRecord: 3.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 38ms (Views: 30.1ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (7.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 09:04:13.570219' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 17.6ms)  (1.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (5.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 7.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:04:13 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:04:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (8.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (4.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:04:13.762729' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:04:13.838140' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.0ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:04:13.911282' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (7.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 09:04:14 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 09:04:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 24ms (ActiveRecord: 7.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 30ms (Views: 20.6ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (2.5ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (8.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 30ms (ActiveRecord: 15.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (5.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 35ms (Views: 26.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 68ms (Views: 61.2ms | ActiveRecord: 3.7ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 20ms (Views: 19.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (10.9ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 53ms (Views: 40.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1  (6.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 09:04:14.526938' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 30ms (ActiveRecord: 7.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.2ms) begin transaction  (2.3ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Completed 200 OK in 143ms (Views: 17.5ms | ActiveRecord: 0.0ms) Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (10.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 09:07:18', '2012-10-26 09:07:18') Fixture Delete (1.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (1.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 09:07:19', '2012-10-26 09:07:19', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 09:07:19', '2012-10-26 09:07:19', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (1.3ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 09:07:19', '2012-10-26 09:07:19') Fixture Insert (0.3ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 09:07:19', '2012-10-26 09:07:19')  (162.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:07:19.343600' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (10.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (7.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (14.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 195ms (ActiveRecord: 15.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (15.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 16.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 206ms (ActiveRecord: 12.3ms) Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.5ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 23ms (ActiveRecord: 4.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (4.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00]] Disclaimer::SegmentHolder Load (5.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 61ms (ActiveRecord: 12.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.3ms) SAVEPOINT active_record_1 SQL (5.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 09:07:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 17ms (ActiveRecord: 5.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.9ms) rollback transaction  (7.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 197ms (Views: 188.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 27ms (ActiveRecord: 8.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.8ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 88ms (Views: 82.1ms | ActiveRecord: 3.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 27ms (Views: 19.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 20ms (Views: 18.2ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 24ms (Views: 15.0ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (5.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 09:07:21.130982' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 7.7ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 6.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (6.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (3.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:07:21 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:07:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (4.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:07:21.338399' WHERE "disclaimer_segments"."id" = 1  (1.6ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:07:21.442240' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (4.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (2.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (5.3ms) begin transaction Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:07:21.549529' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (2.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (4.6ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (1.4ms) SAVEPOINT active_record_1 SQL (5.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 09:07:21 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 09:07:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 22ms (ActiveRecord: 6.4ms)  (0.7ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 44ms (Views: 39.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (6.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (1.5ms) SAVEPOINT active_record_1 SQL (5.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 25ms (ActiveRecord: 12.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 29ms (Views: 24.7ms | ActiveRecord: 0.2ms)  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (4.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 45ms (Views: 39.2ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 34ms (Views: 33.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (3.1ms) Completed 200 OK in 47ms (Views: 37.7ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (6.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (4.5ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 09:07:22.165003' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 26ms (ActiveRecord: 4.8ms)  (1.7ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.8ms) rollback transaction  (0.2ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 500 Internal Server Error in 136ms  (0.1ms) rollback transaction Connecting to database specified by database.yml  (0.8ms) begin transaction Fixture Delete (3.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 09:08:36', '2012-10-26 09:08:36') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (2.9ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 09:08:36', '2012-10-26 09:08:36', 980190962) Fixture Insert (0.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 09:08:36', '2012-10-26 09:08:36', 298486374) Fixture Delete (7.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 09:08:36', '2012-10-26 09:08:36') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 09:08:36', '2012-10-26 09:08:36')  (168.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (11.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:08:37.046528' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 139ms (ActiveRecord: 10.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (10.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 11.2ms) Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:08:37 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:08:37 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:08:37 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:08:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 164ms (ActiveRecord: 6.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (4.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 3.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.0ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 6.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 75ms (ActiveRecord: 2.8ms) Disclaimer::Document Load (3.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.0ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 18ms (ActiveRecord: 7.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 193ms (Views: 181.8ms | ActiveRecord: 0.5ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (4.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 26ms (ActiveRecord: 5.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 103ms (Views: 90.5ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (2.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 34ms (Views: 28.6ms | ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 26ms (Views: 24.3ms | ActiveRecord: 0.8ms)  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 24ms (Views: 17.7ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (9.9ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (6.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (4.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 09:08:38.780918' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 19.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (5.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 28ms (ActiveRecord: 7.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (3.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:08:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (5.7ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:08:38.959182' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.1ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:08:39.056600' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.9ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:08:39.174609' WHERE "disclaimer_segment_holders"."id" = 980190962  (3.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.8ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.2ms) SAVEPOINT active_record_1 SQL (7.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 09:08:39 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 09:08:39 UTC +00:00]]  (7.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 32ms (ActiveRecord: 14.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 34ms (Views: 28.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (11.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 37ms (ActiveRecord: 13.2ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 22.2ms | ActiveRecord: 0.2ms)  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 59ms (Views: 46.7ms | ActiveRecord: 4.0ms) Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 14ms (Views: 13.2ms | ActiveRecord: 0.0ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.9ms) Completed 200 OK in 52ms (Views: 44.0ms | ActiveRecord: 0.2ms)  (4.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 09:08:39.777240' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 25ms (ActiveRecord: 6.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) rollback transaction  (0.1ms) begin transaction  (1.4ms) rollback transaction  (9.5ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 500 Internal Server Error in 139ms  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.2ms) begin transaction Fixture Delete (2.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 09:09:40', '2012-10-26 09:09:40') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 09:09:40', '2012-10-26 09:09:40', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 09:09:40', '2012-10-26 09:09:40', 298486374) Fixture Delete (4.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 09:09:40', '2012-10-26 09:09:40') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 09:09:40', '2012-10-26 09:09:40')  (200.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (7.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:09:40.988906' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (6.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (6.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 190ms (ActiveRecord: 7.2ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (4.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (11.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 16.2ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (6.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 136ms (ActiveRecord: 2.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (3.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (1.5ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 11.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:09:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (9.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (17.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:09:42 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 09:09:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 33ms (ActiveRecord: 17.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.3ms) rollback transaction  (2.3ms) begin transaction Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 165ms (Views: 159.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (6.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (9.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 37ms (ActiveRecord: 16.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 90ms (Views: 85.1ms | ActiveRecord: 2.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (2.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 31ms (Views: 27.2ms | ActiveRecord: 2.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 69ms (Views: 67.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 40ms (Views: 27.0ms | ActiveRecord: 2.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 09:09:42.743848' WHERE "disclaimer_documents"."id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 10.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 6.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:09:42 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:09:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (10.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:09:42.934857' WHERE "disclaimer_segments"."id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (3.3ms) SAVEPOINT active_record_1 SQL (4.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:09:43.023430' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (10.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:09:43.102642' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.8ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 09:09:43 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 09:09:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 28ms (ActiveRecord: 6.0ms)  (4.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 34ms (Views: 25.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 23ms (ActiveRecord: 4.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (3.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (6.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 38ms (Views: 29.8ms | ActiveRecord: 6.4ms)  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (5.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 69ms (Views: 57.1ms | ActiveRecord: 6.0ms) Disclaimer::Segment Load (5.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 16ms (Views: 13.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 49ms (Views: 42.3ms | ActiveRecord: 2.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1  (3.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 09:09:43.714647' WHERE "disclaimer_segments"."id" = 1  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 22ms (ActiveRecord: 4.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Completed 500 Internal Server Error in 11ms  (0.2ms) rollback transaction Connecting to database specified by database.yml  (0.9ms) begin transaction Fixture Delete (1.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.5ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 09:10:04', '2012-10-26 09:10:04') Fixture Delete (2.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 09:10:04', '2012-10-26 09:10:04', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 09:10:04', '2012-10-26 09:10:04', 298486374) Fixture Delete (6.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 09:10:04', '2012-10-26 09:10:04') Fixture Insert (1.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 09:10:04', '2012-10-26 09:10:04')  (179.7ms) commit transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:10:05.255348' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 19ms (ActiveRecord: 0.4ms)  (5.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (7.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 197ms (ActiveRecord: 5.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 22ms (ActiveRecord: 4.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (6.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (5.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 198ms (ActiveRecord: 17.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 29ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (9.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 28ms (ActiveRecord: 4.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.3ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 82ms (Views: 80.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 4.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 47ms (Views: 45.2ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 45ms (Views: 42.2ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 27ms (Views: 26.5ms | ActiveRecord: 0.3ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 31ms (Views: 26.9ms | ActiveRecord: 0.5ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 09:10:06.801433' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 6.1ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (10.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 33ms (ActiveRecord: 11.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:10:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (4.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (6.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:10:07.030225' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (8.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:10:07.145112' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (3.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:10:07.249513' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (7.9ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 09:10:07 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 09:10:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 42ms (ActiveRecord: 8.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 38ms (Views: 30.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (5.4ms) SAVEPOINT active_record_1 SQL (4.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 33ms (ActiveRecord: 10.0ms)  (6.6ms) SELECT COUNT(*) FROM "disclaimer_segments"   (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 33ms (Views: 23.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 49ms (Views: 44.8ms | ActiveRecord: 0.7ms) Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 27ms (Views: 26.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (5.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (9.5ms) Completed 200 OK in 53ms (Views: 46.0ms | ActiveRecord: 5.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (3.7ms) SAVEPOINT active_record_1  (7.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 09:10:07.924846' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 29ms (ActiveRecord: 11.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.1ms) rollback transaction  (0.1ms) begin transaction  (0.3ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Completed 500 Internal Server Error in 96ms  (0.1ms) rollback transaction Connecting to database specified by database.yml  (1.8ms) begin transaction Fixture Delete (1.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 09:12:02', '2012-10-26 09:12:02') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 09:12:02', '2012-10-26 09:12:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 09:12:02', '2012-10-26 09:12:02', 298486374) Fixture Delete (2.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.0ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 09:12:02', '2012-10-26 09:12:02') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 09:12:02', '2012-10-26 09:12:02')  (272.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) SAVEPOINT active_record_1  (2.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:12:02.944189' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 3.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 177ms (ActiveRecord: 9.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (8.9ms) begin transaction Disclaimer::Document Load (7.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (7.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 12.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 155ms (ActiveRecord: 16.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (7.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 13.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:12:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 51ms (ActiveRecord: 2.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:12:04 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 09:12:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 14ms (ActiveRecord: 4.6ms)  (3.6ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 143ms (Views: 139.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 25ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.7ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 74ms (Views: 67.1ms | ActiveRecord: 1.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 28ms (Views: 21.6ms | ActiveRecord: 3.4ms) Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (8.9ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 44ms (Views: 33.9ms | ActiveRecord: 9.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (6.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 25ms (Views: 13.5ms | ActiveRecord: 6.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 09:12:04.602530' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 18.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (3.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 9.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:12:04 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:12:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (4.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.3ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:12:04.798515' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:12:04.850354' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (10.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:12:04.947007' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (16.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 09:12:05 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 09:12:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 33ms (ActiveRecord: 16.2ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 52ms (Views: 38.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (1.3ms) SAVEPOINT active_record_1 SQL (6.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 25ms (ActiveRecord: 7.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 43ms (Views: 37.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (3.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 38ms (Views: 33.8ms | ActiveRecord: 0.7ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 27ms (Views: 26.0ms | ActiveRecord: 0.0ms)  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.3ms) Completed 200 OK in 32ms (Views: 28.1ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (8.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 09:12:05.567602' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 23ms (ActiveRecord: 8.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (7.9ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 149ms (ActiveRecord: 0.2ms) Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) rollback transaction Connecting to database specified by database.yml  (2.2ms) begin transaction Fixture Delete (1.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (6.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 09:13:05', '2012-10-26 09:13:05') Fixture Delete (7.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 09:13:05', '2012-10-26 09:13:05', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 09:13:05', '2012-10-26 09:13:05', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 09:13:05', '2012-10-26 09:13:05') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 09:13:05', '2012-10-26 09:13:05')  (185.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:13:06.148677' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (12.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 18ms (ActiveRecord: 0.1ms)  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 173ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:13:06 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:13:06 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:13:06 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:13:06 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 80ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 6.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (6.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 27ms (ActiveRecord: 9.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00]]  (2.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 54ms (ActiveRecord: 8.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (11.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 31ms (ActiveRecord: 11.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 177ms (Views: 165.9ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 22ms (ActiveRecord: 4.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 89ms (Views: 77.2ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (6.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 29ms (Views: 17.9ms | ActiveRecord: 6.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (3.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (2.8ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 58ms (Views: 44.6ms | ActiveRecord: 9.0ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 47ms (Views: 40.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 09:13:07.811405' WHERE "disclaimer_documents"."id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 50ms (ActiveRecord: 12.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (7.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (10.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 18.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 09:13:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (7.4ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 09:13:08.027512' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (6.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (10.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:13:08.140564' WHERE "disclaimer_segment_holders"."id" = 980190962  (3.9ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.8ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 09:13:08.250197' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.3ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 09:13:08 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 09:13:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 26ms (ActiveRecord: 3.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (6.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 38ms (Views: 31.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 29ms (ActiveRecord: 5.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 52ms (Views: 37.6ms | ActiveRecord: 2.5ms)  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (3.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (3.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 60ms (Views: 50.8ms | ActiveRecord: 7.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 13ms (Views: 12.8ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 50ms (Views: 44.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 09:13:08.950051' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 19ms (ActiveRecord: 5.3ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 110ms (ActiveRecord: 0.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (2.0ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (7.2ms) begin transaction Fixture Delete (7.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 10:14:07', '2012-10-26 10:14:07') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 10:14:07', '2012-10-26 10:14:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 10:14:07', '2012-10-26 10:14:07', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 10:14:07', '2012-10-26 10:14:07') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 10:14:07', '2012-10-26 10:14:07')  (210.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:14:07.434845' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 15ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 151ms (ActiveRecord: 5.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 4.8ms) Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (8.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 159ms (ActiveRecord: 4.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 6.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00]] Disclaimer::SegmentHolder Load (3.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 66ms (ActiveRecord: 14.8ms) Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.0ms) SAVEPOINT active_record_1 SQL (9.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 10:14:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 36ms (ActiveRecord: 9.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 186ms (Views: 183.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.7ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (6.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 25ms (ActiveRecord: 7.7ms)  (0.7ms) SELECT COUNT(*) FROM "disclaimer_documents"  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (4.8ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.9ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 114ms (Views: 93.8ms | ActiveRecord: 6.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 39ms (Views: 33.6ms | ActiveRecord: 2.4ms) Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 58ms (Views: 57.4ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (6.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 49ms (Views: 36.9ms | ActiveRecord: 6.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (2.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (5.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 10:14:09.342409' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 13.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (6.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (8.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 7.1ms) Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (1.7ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:09 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:14:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:14:09.539762' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.8ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:14:09.656693' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.9ms) begin transaction Disclaimer::Document Load (2.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (3.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:14:09.728399' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (9.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 10:14:09 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 10:14:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 20ms (ActiveRecord: 9.3ms)  (7.7ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 43.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (6.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (6.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 31ms (ActiveRecord: 7.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 39ms (Views: 33.1ms | ActiveRecord: 2.8ms)  (0.1ms) rollback transaction  (1.6ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (10.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 54ms (Views: 39.3ms | ActiveRecord: 11.2ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 38ms (Views: 37.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (5.8ms) Completed 200 OK in 72ms (Views: 50.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (2.6ms) begin transaction Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (4.5ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 10:14:10.396004' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 22ms (ActiveRecord: 4.8ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.5ms) rollback transaction  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Completed 500 Internal Server Error in 6ms  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (6.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 10:14:48', '2012-10-26 10:14:48') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 10:14:48', '2012-10-26 10:14:48', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 10:14:48', '2012-10-26 10:14:48', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 10:14:48', '2012-10-26 10:14:48') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 10:14:48', '2012-10-26 10:14:48')  (217.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:14:48.701497' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.7ms) rollback transaction  (1.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 15ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 245ms (ActiveRecord: 15.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 4.7ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:49 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:14:49 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:49 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:14:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 182ms (ActiveRecord: 16.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 46ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 4.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00]] Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 70ms (ActiveRecord: 11.4ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 23ms (ActiveRecord: 6.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 163ms (Views: 157.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 38ms (ActiveRecord: 5.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (6.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 101ms (Views: 91.8ms | ActiveRecord: 6.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (5.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 38ms (Views: 26.6ms | ActiveRecord: 5.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 40ms (Views: 38.8ms | ActiveRecord: 0.5ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 35ms (Views: 27.4ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (6.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 10:14:50.775238' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 38ms (ActiveRecord: 8.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 6.5ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:14:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (3.4ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:14:50.959774' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (5.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (4.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.5ms) SAVEPOINT active_record_1 SQL (4.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:14:51.067513' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (9.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:14:51.151116' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (17.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 10:14:51 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 10:14:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 33ms (ActiveRecord: 17.8ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (5.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 43ms (Views: 37.8ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (12.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 39ms (ActiveRecord: 13.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 41.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (2.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (8.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 68ms (Views: 47.0ms | ActiveRecord: 13.9ms) Disclaimer::Segment Load (5.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 17ms (Views: 15.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (2.7ms) Completed 200 OK in 35ms (Views: 29.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 10:14:51.822214' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 30ms (ActiveRecord: 8.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) rollback transaction  (2.6ms) begin transaction  (0.1ms) rollback transaction  (0.2ms) begin transaction Processing by SampleController#index as HTML Completed 500 Internal Server Error in 1ms  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 10:23:14', '2012-10-26 10:23:14') Fixture Delete (12.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 10:23:14', '2012-10-26 10:23:14', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 10:23:14', '2012-10-26 10:23:14', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 10:23:14', '2012-10-26 10:23:14') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 10:23:14', '2012-10-26 10:23:14')  (168.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (5.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:23:14.898516' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (16.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (9.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 27ms (ActiveRecord: 0.2ms)  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (7.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (4.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 223ms (ActiveRecord: 6.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (7.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 7.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:23:15 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:23:15 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:23:15 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:23:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 191ms (ActiveRecord: 12.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 29ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (5.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00]] Disclaimer::SegmentHolder Load (1.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 9.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (15.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 38ms (ActiveRecord: 15.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 127ms (Views: 120.3ms | ActiveRecord: 0.1ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (8.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.6ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 19ms (ActiveRecord: 3.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 84ms (Views: 79.9ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 26ms (Views: 23.9ms | ActiveRecord: 0.2ms) Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 45ms (Views: 44.2ms | ActiveRecord: 0.6ms)  (1.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 21ms (Views: 19.0ms | ActiveRecord: 0.5ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (14.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (9.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 10:23:16.705554' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 60ms (ActiveRecord: 26.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 6.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:23:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (4.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (6.8ms) SAVEPOINT active_record_1  (5.4ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:23:16.928616' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (6.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.0ms) SAVEPOINT active_record_1 SQL (5.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:23:17.032423' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.5ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.4ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:23:17.107185' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (2.7ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.2ms) SAVEPOINT active_record_1 SQL (8.8ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 10:23:17 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 10:23:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 41ms (ActiveRecord: 9.1ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 85ms (Views: 63.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (15.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 20ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (2.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 35ms (Views: 31.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (4.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 82ms (Views: 63.3ms | ActiveRecord: 5.0ms) Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 30ms (Views: 29.9ms | ActiveRecord: 0.0ms)  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (7.9ms) Completed 200 OK in 108ms (Views: 102.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1  (8.5ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 10:23:18.120613' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 62ms (ActiveRecord: 9.0ms)  (16.8ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Processing by SampleController#index as HTML Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (9.8ms) begin transaction Fixture Delete (6.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 10:26:05', '2012-10-26 10:26:05') Fixture Delete (2.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 10:26:05', '2012-10-26 10:26:05', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 10:26:05', '2012-10-26 10:26:05', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 10:26:05', '2012-10-26 10:26:05') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 10:26:05', '2012-10-26 10:26:05')  (249.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (11.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:26:06.288851' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (7.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 213ms (ActiveRecord: 7.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 47ms (ActiveRecord: 7.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 120ms (ActiveRecord: 7.0ms) Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (9.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 8.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (12.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00]] Disclaimer::SegmentHolder Load (1.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00]]  (4.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 75ms (ActiveRecord: 24.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (10.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 10:26:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 27ms (ActiveRecord: 10.6ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 179ms (Views: 171.3ms | ActiveRecord: 2.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 19ms (ActiveRecord: 6.3ms)  (1.8ms) SELECT COUNT(*) FROM "disclaimer_documents"  (2.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 97ms (Views: 95.3ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 31ms (Views: 27.8ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 43ms (Views: 37.5ms | ActiveRecord: 4.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (6.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 39ms (Views: 26.3ms | ActiveRecord: 6.9ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (4.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (1.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 10:26:08.173052' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 47ms (ActiveRecord: 13.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (4.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 6.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.1ms) rollback transaction  (8.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:08 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:26:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (2.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:26:08.379964' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (11.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:26:08.466520' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:26:08.565571' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (14.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 10:26:08 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 10:26:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 30ms (ActiveRecord: 14.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (5.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 19.3ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 22ms (ActiveRecord: 4.6ms)  (2.0ms) SELECT COUNT(*) FROM "disclaimer_segments"  (3.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 58ms (Views: 42.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (4.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 75ms (Views: 63.2ms | ActiveRecord: 7.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 42ms (Views: 41.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 38ms (Views: 31.1ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 10:26:09.170899' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 10ms (ActiveRecord: 5.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Completed 500 Internal Server Error in 109ms  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (7.4ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 10:26:47', '2012-10-26 10:26:47') Fixture Delete (5.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 10:26:47', '2012-10-26 10:26:47', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 10:26:47', '2012-10-26 10:26:47', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.3ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 10:26:47', '2012-10-26 10:26:47') Fixture Insert (0.5ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 10:26:47', '2012-10-26 10:26:47')  (227.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:26:47.592371' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 276ms (ActiveRecord: 6.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 55ms (ActiveRecord: 9.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 163ms (ActiveRecord: 13.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.8ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 3.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 8.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 58ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (10.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 10:26:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 33ms (ActiveRecord: 10.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 245ms (Views: 238.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (10.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 37ms (ActiveRecord: 11.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (6.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 87ms (Views: 81.1ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (5.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 35ms (Views: 26.6ms | ActiveRecord: 5.2ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (1.6ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 37ms (Views: 35.0ms | ActiveRecord: 2.0ms)  (0.1ms) rollback transaction  (5.0ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (5.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (6.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 46ms (Views: 30.6ms | ActiveRecord: 12.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 10:26:49.674486' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 9.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (7.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 38ms (ActiveRecord: 14.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (6.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (8.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 10:26:49 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 10:26:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (3.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 10:26:49.876936' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:26:49.953873' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (6.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 10:26:50.017491' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (14.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 10:26:50 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 10:26:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 31ms (ActiveRecord: 14.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.9ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 20.4ms | ActiveRecord: 2.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 34ms (ActiveRecord: 5.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 44ms (Views: 38.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 33ms (Views: 21.0ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 10ms (Views: 9.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 20ms (Views: 12.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (5.7ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 10:26:50.507861' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 11ms (ActiveRecord: 6.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (6.8ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 22ms (ActiveRecord: 0.2ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (2.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 11:50:37', '2012-10-26 11:50:37') Fixture Delete (3.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 11:50:37', '2012-10-26 11:50:37', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 11:50:37', '2012-10-26 11:50:37', 298486374) Fixture Delete (1.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 11:50:37', '2012-10-26 11:50:37') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 11:50:37', '2012-10-26 11:50:37')  (409.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (5.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 11:50:38.302823' WHERE "disclaimer_documents"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (8.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 15ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (7.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (13.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 248ms (ActiveRecord: 21.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.4ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 29ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (6.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (16.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00]] Disclaimer::SegmentHolder Load (1.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 183ms (ActiveRecord: 26.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 33ms (ActiveRecord: 6.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (6.6ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (2.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00]] Disclaimer::SegmentHolder Load (3.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 76ms (ActiveRecord: 24.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (12.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 11:50:39 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 38ms (ActiveRecord: 12.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 171ms (Views: 159.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 18ms (ActiveRecord: 5.0ms)  (1.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (11.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 100ms (Views: 76.3ms | ActiveRecord: 12.0ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 41ms (Views: 35.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (6.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (4.7ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 42ms (Views: 30.7ms | ActiveRecord: 10.9ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 38ms (Views: 33.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 11:50:40.249498' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 8.5ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (8.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (6.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 33ms (ActiveRecord: 8.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (2.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (13.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:50:40 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 11:50:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (4.4ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 11:50:40.454593' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (3.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 11:50:40.553553' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.8ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (2.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 11:50:40.639673' WHERE "disclaimer_segment_holders"."id" = 980190962  (1.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (10.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (6.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 11:50:40 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 11:50:40 UTC +00:00]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 37ms (ActiveRecord: 8.5ms)  (1.6ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (4.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 46ms (Views: 40.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 23ms (ActiveRecord: 7.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (5.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 32ms (Views: 23.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 74ms (Views: 65.3ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (4.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 31ms (Views: 30.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (5.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (6.2ms) Completed 200 OK in 54ms (Views: 44.5ms | ActiveRecord: 5.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (2.6ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 11:50:41.400394' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 74ms (ActiveRecord: 5.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 155ms (ActiveRecord: 0.4ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (8.5ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 11:51:17', '2012-10-26 11:51:17') Fixture Delete (10.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 11:51:17', '2012-10-26 11:51:17', 980190962) Fixture Insert (1.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 11:51:17', '2012-10-26 11:51:17', 298486374) Fixture Delete (4.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 11:51:17', '2012-10-26 11:51:17') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 11:51:17', '2012-10-26 11:51:17')  (165.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 11:51:17.586939' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (11.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 0.2ms)  (1.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 243ms (ActiveRecord: 10.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.9ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 9.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00]]  (4.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 207ms (ActiveRecord: 13.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (4.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 4.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00]] Disclaimer::SegmentHolder Load (4.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 67ms (ActiveRecord: 9.7ms) Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 11:51:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 27ms (ActiveRecord: 5.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (4.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 160ms (Views: 151.8ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 22ms (ActiveRecord: 6.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 95ms (Views: 83.0ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (3.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 42ms (Views: 34.5ms | ActiveRecord: 5.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (7.9ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 48ms (Views: 39.1ms | ActiveRecord: 8.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 24ms (Views: 21.6ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.8ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.2ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 11:51:19.599562' WHERE "disclaimer_documents"."id" = 1  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 8.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (15.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 8.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 11:51:19 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 11:51:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (5.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 11:51:19.805637' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (10.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (7.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (6.1ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 11:51:19.892892' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 11:51:19.983525' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (1.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (6.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.9ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 11:51:20 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 11:51:20 UTC +00:00]]  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 30ms (ActiveRecord: 7.4ms)  (6.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 37ms (Views: 32.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (2.8ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 21ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (4.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 56ms (Views: 51.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (6.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 42ms (Views: 31.6ms | ActiveRecord: 7.1ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (5.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 19ms (Views: 18.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (3.2ms) Completed 200 OK in 28ms (Views: 19.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (3.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 11:51:20.591232' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 49ms (ActiveRecord: 3.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.0ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 135ms (ActiveRecord: 0.2ms) Disclaimer::Document Load (5.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (5.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:07:00', '2012-10-26 12:07:00') Fixture Delete (13.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:07:00', '2012-10-26 12:07:00', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:07:00', '2012-10-26 12:07:00', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.6ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:07:00', '2012-10-26 12:07:00') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:07:00', '2012-10-26 12:07:00')  (159.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (8.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:07:00.419240' WHERE "disclaimer_documents"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (5.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (8.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 195ms (ActiveRecord: 16.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (14.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 6.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 176ms (ActiveRecord: 8.5ms) Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 12.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (4.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 7.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (10.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:07:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 38ms (ActiveRecord: 10.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 209ms (Views: 201.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 20ms (ActiveRecord: 4.8ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 84ms (Views: 75.1ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (3.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 40ms (Views: 32.9ms | ActiveRecord: 5.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 31ms (Views: 28.8ms | ActiveRecord: 1.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 37ms (Views: 28.1ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:07:02.437319' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 5.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (6.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:07:02 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:07:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:07:02.523018' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:07:02.561737' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:07:02.596929' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:07:02 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:07:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 17ms (Views: 11.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 27ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 38ms (Views: 32.4ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (4.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (4.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 54ms (Views: 46.8ms | ActiveRecord: 5.4ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 24ms (Views: 23.6ms | ActiveRecord: 0.0ms)  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (5.1ms) Completed 200 OK in 47ms (Views: 40.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (1.4ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (3.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:07:03.066766' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 22ms (ActiveRecord: 4.3ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 20ms (ActiveRecord: 1.0ms)  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (4.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 10ms (ActiveRecord: 4.2ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (2.6ms) begin transaction Fixture Delete (9.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (9.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:09:26', '2012-10-26 12:09:26') Fixture Delete (5.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:09:26', '2012-10-26 12:09:26', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:09:26', '2012-10-26 12:09:26', 298486374) Fixture Delete (2.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:09:26', '2012-10-26 12:09:26') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:09:26', '2012-10-26 12:09:26')  (192.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (11.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:09:27.169094' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (4.9ms) begin transaction Disclaimer::Document Load (5.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 195ms (ActiveRecord: 11.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 7.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00]]  (3.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 214ms (ActiveRecord: 13.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 4.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 29ms (ActiveRecord: 6.7ms) Disclaimer::Document Load (8.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 5.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:09:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 32ms (ActiveRecord: 6.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (4.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 208ms (Views: 197.2ms | ActiveRecord: 0.2ms)  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.6ms) SAVEPOINT active_record_1 SQL (4.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 25ms (ActiveRecord: 5.6ms)  (3.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 74ms (Views: 63.3ms | ActiveRecord: 0.8ms)  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 38ms (Views: 30.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 30ms (Views: 29.0ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 47ms (Views: 40.3ms | ActiveRecord: 3.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:09:29.011526' WHERE "disclaimer_documents"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 8.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 8.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:09:29 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:09:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.6ms) SAVEPOINT active_record_1  (3.8ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:09:29.230564' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (3.8ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:09:29.334486' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (2.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:09:29.423331' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.2ms) SAVEPOINT active_record_1 SQL (8.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:09:29 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:09:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 28ms (ActiveRecord: 9.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (4.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 18ms (Views: 15.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (3.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 16ms (ActiveRecord: 6.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (6.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 46ms (Views: 30.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 55ms (Views: 49.5ms | ActiveRecord: 3.7ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 29ms (Views: 28.3ms | ActiveRecord: 0.0ms)  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 55ms (Views: 46.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (6.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:09:30.052333' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 27ms (ActiveRecord: 7.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) rollback transaction  (2.0ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 500 Internal Server Error in 139ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 31ms (Views: 30.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (7.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (12.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:11:23', '2012-10-26 12:11:23') Fixture Delete (3.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:11:23', '2012-10-26 12:11:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:11:23', '2012-10-26 12:11:23', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:11:23', '2012-10-26 12:11:23') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:11:23', '2012-10-26 12:11:23')  (219.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (5.3ms) SAVEPOINT active_record_1  (7.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:11:23.333052' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.0ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (5.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 5.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (3.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 159ms (ActiveRecord: 5.9ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (12.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (3.4ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 15.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00]]  (3.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 155ms (ActiveRecord: 12.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 11.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.8ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 7.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (8.7ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 70ms (ActiveRecord: 17.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (1.4ms) SAVEPOINT active_record_1 SQL (7.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:11:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 20ms (ActiveRecord: 9.0ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 171ms (Views: 164.8ms | ActiveRecord: 3.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.0ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 5.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (2.3ms) rollback transaction  (2.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (3.7ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 91ms (Views: 82.7ms | ActiveRecord: 5.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 34ms (Views: 31.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (3.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 47ms (Views: 41.0ms | ActiveRecord: 3.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 41ms (Views: 30.9ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (4.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.0ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (7.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:11:25.109562' WHERE "disclaimer_documents"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 17.4ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.9ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 12.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:11:25 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:11:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (3.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:11:25.282379' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (5.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:11:25.375085' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (3.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:11:25.469736' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:11:25 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:11:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 20ms (ActiveRecord: 4.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (6.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (5.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 23.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (9.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 23ms (ActiveRecord: 9.8ms)  (2.9ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 19.4ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 62ms (Views: 50.1ms | ActiveRecord: 4.3ms) Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 31ms (Views: 29.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 49ms (Views: 42.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (4.6ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:11:26.058839' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 27ms (ActiveRecord: 6.1ms)  (2.8ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.8ms) rollback transaction  (4.2ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 130ms (ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 14ms (Views: 13.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (11.4ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:17:01', '2012-10-26 12:17:01') Fixture Delete (5.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:17:01', '2012-10-26 12:17:01', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:17:01', '2012-10-26 12:17:01', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:17:01', '2012-10-26 12:17:01') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:17:01', '2012-10-26 12:17:01')  (617.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (3.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:17:02.504379' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (4.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.6ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 134ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 37ms (ActiveRecord: 4.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (9.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00]] Disclaimer::SegmentHolder Load (9.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 144ms (ActiveRecord: 26.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 9.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (4.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 5.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (10.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:17:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 29ms (ActiveRecord: 10.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 197ms (Views: 191.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (2.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.6ms) rollback transaction  (2.6ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (3.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 105ms (Views: 96.7ms | ActiveRecord: 3.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (9.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 41ms (Views: 25.5ms | ActiveRecord: 10.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (4.7ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 44ms (Views: 38.4ms | ActiveRecord: 5.0ms)  (6.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 38ms (Views: 29.1ms | ActiveRecord: 3.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:17:04.190471' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 7.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (12.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:04 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:17:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (6.7ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:17:04.345233' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (4.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (4.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:17:04.454756' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (1.0ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:17:04.517874' WHERE "disclaimer_segment_holders"."id" = 980190962  (2.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (4.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (9.3ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:17:04 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:17:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 28ms (ActiveRecord: 9.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 36.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (8.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (3.8ms) SAVEPOINT active_record_1 SQL (4.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 35ms (ActiveRecord: 16.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 34ms (Views: 24.4ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (7.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 47ms (Views: 33.3ms | ActiveRecord: 7.7ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 28ms (Views: 24.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (5.1ms) Completed 200 OK in 54ms (Views: 45.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (11.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:17:05.139270' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 22ms (ActiveRecord: 11.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 118ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (2.2ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 19ms (Views: 18.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (6.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (13.4ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:17:26', '2012-10-26 12:17:26') Fixture Delete (3.4ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:17:26', '2012-10-26 12:17:26', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:17:26', '2012-10-26 12:17:26', 298486374) Fixture Delete (4.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:17:26', '2012-10-26 12:17:26') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:17:26', '2012-10-26 12:17:26')  (175.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (7.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:17:27.055807' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (7.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.7ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (3.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (15.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 248ms (ActiveRecord: 16.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 50ms (ActiveRecord: 5.7ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (4.5ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 185ms (ActiveRecord: 10.8ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.4ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 6.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 4.1ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (2.8ms) SAVEPOINT active_record_1 SQL (17.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:17:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 33ms (ActiveRecord: 20.1ms)  (2.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 179ms (Views: 173.9ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 24ms (ActiveRecord: 7.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 60ms (Views: 55.2ms | ActiveRecord: 2.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (11.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 41ms (Views: 28.3ms | ActiveRecord: 11.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (12.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (4.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 46ms (Views: 40.2ms | ActiveRecord: 4.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 50ms (Views: 38.1ms | ActiveRecord: 4.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (9.5ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:17:29.046453' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 18.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 4.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:17:29 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:17:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (2.4ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:17:29.234657' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.7ms) rollback transaction  (0.8ms) begin transaction Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:17:29.302461' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (9.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (5.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (3.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:17:29.399268' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (10.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (9.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:17:29 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:17:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 18ms (ActiveRecord: 9.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (8.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 38ms (Views: 29.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (2.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 25ms (ActiveRecord: 4.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 41.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 49ms (Views: 41.6ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 26ms (Views: 25.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 58ms (Views: 44.9ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (1.8ms) SAVEPOINT active_record_1  (5.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:17:30.045208' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 20ms (ActiveRecord: 7.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.9ms) rollback transaction  (0.1ms) begin transaction  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 102ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 23ms (Views: 22.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (7.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:18:21', '2012-10-26 12:18:21') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:18:21', '2012-10-26 12:18:21', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:18:21', '2012-10-26 12:18:21', 298486374) Fixture Delete (2.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:18:21', '2012-10-26 12:18:21') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:18:21', '2012-10-26 12:18:21')  (748.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (4.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:18:22.379948' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 15ms (ActiveRecord: 2.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.8ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 160ms (ActiveRecord: 6.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (5.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 23ms (ActiveRecord: 7.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.9ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 134ms (ActiveRecord: 11.7ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (4.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 9.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 5.0ms) Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (6.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (12.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (3.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 81ms (ActiveRecord: 24.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (16.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:18:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 34ms (ActiveRecord: 16.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 194ms (Views: 183.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (4.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (4.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 94ms (Views: 85.8ms | ActiveRecord: 0.9ms)  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (3.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (6.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 51ms (Views: 35.2ms | ActiveRecord: 10.0ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 48ms (Views: 47.6ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 33ms (Views: 26.3ms | ActiveRecord: 2.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:18:24.156534' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 38ms (ActiveRecord: 11.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 5.0ms) Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:18:24 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:18:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (7.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:18:24.323204' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (3.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (3.4ms) SAVEPOINT active_record_1 SQL (3.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (2.8ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:18:24.419267' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (5.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:18:24.519300' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (21.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:18:24 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:18:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 36ms (ActiveRecord: 21.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (4.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 34ms (Views: 27.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 17ms (ActiveRecord: 8.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (6.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 52ms (Views: 38.1ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 61ms (Views: 53.3ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 21ms (Views: 20.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 54ms (Views: 42.3ms | ActiveRecord: 2.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (3.1ms) SAVEPOINT active_record_1  (5.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:18:25.158335' WHERE "disclaimer_segments"."id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 28ms (ActiveRecord: 9.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.8ms) rollback transaction  (4.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 104ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 27ms (Views: 26.1ms | ActiveRecord: 0.0ms)  (6.2ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:19:04', '2012-10-26 12:19:04') Fixture Delete (3.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (2.6ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:19:04', '2012-10-26 12:19:04', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:19:04', '2012-10-26 12:19:04', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:19:04', '2012-10-26 12:19:04') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:19:04', '2012-10-26 12:19:04')  (525.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:19:05.190501' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (7.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (11.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 3.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 164ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (4.4ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 9.5ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (4.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:05 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:19:05 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:05 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:19:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 131ms (ActiveRecord: 7.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 5.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:06 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:19:06 UTC +00:00]] Disclaimer::SegmentHolder Load (6.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:06 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:19:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 73ms (ActiveRecord: 9.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (9.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:06 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:19:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 31ms (ActiveRecord: 9.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 187ms (Views: 184.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 29ms (ActiveRecord: 4.6ms)  (1.7ms) SELECT COUNT(*) FROM "disclaimer_documents"  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (2.9ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 92ms (Views: 83.7ms | ActiveRecord: 3.3ms)  (0.1ms) rollback transaction  (4.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 43ms (Views: 38.7ms | ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 31ms (Views: 29.5ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (6.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 27ms (Views: 16.7ms | ActiveRecord: 6.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.2ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:19:06.868551' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 11.6ms)  (2.0ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 2.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (16.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:07 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (5.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (7.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:19:07.034288' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (2.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (5.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:19:07.079727' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (5.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:19:07.116932' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.3ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:19:07 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:19:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 11ms (ActiveRecord: 6.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 16.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 10ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 40ms (Views: 38.4ms | ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 72ms (Views: 65.9ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 12ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (4.7ms) Completed 200 OK in 31ms (Views: 28.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:19:07.549165' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 33ms (ActiveRecord: 5.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 106ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 27ms (Views: 27.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (1.1ms) begin transaction Fixture Delete (10.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (4.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:19:32', '2012-10-26 12:19:32') Fixture Delete (2.2ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:19:32', '2012-10-26 12:19:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:19:32', '2012-10-26 12:19:32', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:19:32', '2012-10-26 12:19:32') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:19:32', '2012-10-26 12:19:32')  (167.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.1ms) SAVEPOINT active_record_1  (7.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:19:32.541484' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (7.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 104ms (ActiveRecord: 7.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (5.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 5.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 85ms (ActiveRecord: 8.7ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 8.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 9ms (ActiveRecord: 4.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 99ms (Views: 92.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 15ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 32ms (Views: 30.1ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 11.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 24ms (Views: 22.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 15ms (Views: 12.7ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:19:33.700193' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 5.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (5.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:19:33.780178' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:19:33.820832' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (4.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:19:33.859807' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:19:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 5.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 12.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (4.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 11ms (ActiveRecord: 4.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 24ms (Views: 22.0ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (4.7ms) Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:19:34.114863' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 66ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (5.7ms) begin transaction Fixture Delete (3.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (5.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:20:25', '2012-10-26 12:20:25') Fixture Delete (5.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:20:25', '2012-10-26 12:20:25', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:20:25', '2012-10-26 12:20:25', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:20:25', '2012-10-26 12:20:25') Fixture Insert (0.9ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:20:25', '2012-10-26 12:20:25')  (177.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (5.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:20:25.936966' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (4.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 4.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (10.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 208ms (ActiveRecord: 11.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 6.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (7.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 181ms (ActiveRecord: 6.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 7.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (7.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:20:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 28ms (ActiveRecord: 7.7ms)  (4.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 150ms (Views: 145.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 1.7ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (3.9ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 68ms (Views: 49.8ms | ActiveRecord: 5.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 36ms (Views: 32.6ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (5.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 46ms (Views: 43.1ms | ActiveRecord: 2.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 39ms (Views: 30.9ms | ActiveRecord: 3.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (12.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:20:27.846395' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 13.4ms)  (1.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 6.9ms) Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (1.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (11.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:20:28 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:20:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (6.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:20:28.044348' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (2.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:20:28.113150' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (9.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:20:28.199277' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:20:28 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:20:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 27ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (5.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 28ms (Views: 19.6ms | ActiveRecord: 5.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 34ms (ActiveRecord: 5.0ms)  (4.8ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (4.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 39ms (Views: 27.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 58ms (Views: 49.7ms | ActiveRecord: 2.1ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 26ms (Views: 23.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (4.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 50ms (Views: 43.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:20:28.859906' WHERE "disclaimer_segments"."id" = 1  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 25ms (ActiveRecord: 6.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (5.9ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 136ms (ActiveRecord: 0.2ms)  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 20ms (Views: 20.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.0ms) begin transaction Fixture Delete (13.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (6.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:21:52', '2012-10-26 12:21:52') Fixture Delete (15.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:21:52', '2012-10-26 12:21:52', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:21:52', '2012-10-26 12:21:52', 298486374) Fixture Delete (6.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:21:52', '2012-10-26 12:21:52') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:21:52', '2012-10-26 12:21:52')  (305.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) SAVEPOINT active_record_1  (3.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:21:52.938412' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (8.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 16ms (ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 214ms (ActiveRecord: 7.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 8.3ms) Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (5.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (3.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:21:53 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:21:53 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:21:53 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:21:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 157ms (ActiveRecord: 16.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (6.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 51ms (ActiveRecord: 15.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (8.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:21:54 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:21:54 UTC +00:00]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:21:54 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:21:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 90ms (ActiveRecord: 11.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (2.1ms) SAVEPOINT active_record_1 SQL (5.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:21:54 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:21:54 UTC +00:00]]  (1.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 24ms (ActiveRecord: 9.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (4.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 224ms (Views: 217.2ms | ActiveRecord: 0.2ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (4.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 34ms (ActiveRecord: 7.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 118ms (Views: 103.9ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 49ms (Views: 41.1ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 38ms (Views: 36.6ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 31ms (Views: 24.2ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (12.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:21:55.093528' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 14.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (5.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 7.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:21:55 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:21:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.6ms) SAVEPOINT active_record_1  (6.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:21:55.285566' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (5.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:21:55.413503' WHERE "disclaimer_segment_holders"."id" = 980190962  (3.5ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.8ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (3.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:21:55.527761' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.5ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (3.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.8ms) SAVEPOINT active_record_1 SQL (4.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:21:55 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:21:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 16ms (ActiveRecord: 5.5ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (3.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 17.7ms | ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 15ms (ActiveRecord: 5.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 27ms (Views: 21.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (4.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 30ms (Views: 24.0ms | ActiveRecord: 0.9ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 14ms (Views: 10.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 32ms (Views: 26.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1  (2.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:21:55.911078' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 14ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 88ms (ActiveRecord: 2.6ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 12ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (6.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (8.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:24:02', '2012-10-26 12:24:02') Fixture Delete (1.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:24:02', '2012-10-26 12:24:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:24:02', '2012-10-26 12:24:02', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:24:02', '2012-10-26 12:24:02') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:24:02', '2012-10-26 12:24:02')  (498.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:24:03.221169' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (4.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 208ms (ActiveRecord: 9.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (7.8ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (5.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (15.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 54ms (ActiveRecord: 16.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 218ms (ActiveRecord: 7.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 3.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (10.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 27ms (ActiveRecord: 11.6ms) Disclaimer::Document Load (10.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.8ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00]] Disclaimer::SegmentHolder Load (6.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 43ms (ActiveRecord: 12.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.3ms) SAVEPOINT active_record_1 SQL (5.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:24:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 22ms (ActiveRecord: 5.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 215ms (Views: 205.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.7ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 16ms (ActiveRecord: 5.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 86ms (Views: 71.3ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (6.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 48ms (Views: 39.4ms | ActiveRecord: 7.1ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 52ms (Views: 51.4ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 34ms (Views: 30.0ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (7.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:24:05.143467' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 12.0ms)  (2.8ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (3.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 5.9ms) Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (10.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:05 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:24:05 UTC +00:00]]  (4.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (10.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:24:05.313657' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (6.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:24:05.404072' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:24:05.523879' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (11.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (7.5ms) SAVEPOINT active_record_1 SQL (9.9ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:24:05 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:24:05 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 34ms (ActiveRecord: 17.9ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (4.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 46ms (Views: 34.5ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.8ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (10.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 16ms (ActiveRecord: 11.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.0ms | ActiveRecord: 0.2ms)  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (6.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (6.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 35ms (Views: 22.7ms | ActiveRecord: 7.7ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 12ms (Views: 11.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 37ms (Views: 29.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (6.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:24:06.096296' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 28ms (ActiveRecord: 7.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 94ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 18ms (Views: 17.5ms | ActiveRecord: 0.0ms)  (0.3ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (6.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (4.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:24:34', '2012-10-26 12:24:34') Fixture Delete (2.4ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:24:34', '2012-10-26 12:24:34', 980190962) Fixture Insert (1.5ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:24:34', '2012-10-26 12:24:34', 298486374) Fixture Delete (1.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:24:34', '2012-10-26 12:24:34') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:24:34', '2012-10-26 12:24:34')  (272.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:24:34.714667' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 2.8ms)  (1.6ms) rollback transaction  (0.9ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (6.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 205ms (ActiveRecord: 19.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (9.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (7.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 4.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 152ms (ActiveRecord: 6.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (9.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 9.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (4.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 5.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:24:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 24ms (ActiveRecord: 6.2ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 201ms (Views: 192.1ms | ActiveRecord: 0.2ms)  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 5.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (7.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 82ms (Views: 69.7ms | ActiveRecord: 7.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 48ms (Views: 35.5ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 44ms (Views: 40.8ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (8.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 42ms (Views: 28.2ms | ActiveRecord: 9.0ms)  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:24:36.442964' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 10.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 8.5ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:24:36 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:24:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (6.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:24:36.637169' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:24:36.725671' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:24:36.823553' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (7.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (15.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:24:36 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:24:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 34ms (ActiveRecord: 15.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (9.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 61ms (Views: 49.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 17ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 51ms (Views: 44.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 69ms (Views: 59.0ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 29ms (Views: 27.8ms | ActiveRecord: 0.0ms)  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (6.0ms) Completed 200 OK in 47ms (Views: 41.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1  (3.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:24:37.496763' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 24ms (ActiveRecord: 3.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.8ms) rollback transaction  (2.5ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 120ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 22ms (Views: 21.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (7.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (4.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:26:22', '2012-10-26 12:26:22') Fixture Delete (5.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:26:22', '2012-10-26 12:26:22', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:26:22', '2012-10-26 12:26:22', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (1.0ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:26:22', '2012-10-26 12:26:22') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:26:22', '2012-10-26 12:26:22')  (231.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (12.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:26:22.533676' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (5.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (11.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 222ms (ActiveRecord: 4.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (15.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (10.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 14.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 121ms (ActiveRecord: 7.2ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (10.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 8.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (5.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 50ms (ActiveRecord: 9.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 12:26:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 21ms (ActiveRecord: 3.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 183ms (Views: 173.5ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 21ms (ActiveRecord: 5.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (5.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 101ms (Views: 91.4ms | ActiveRecord: 5.8ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (5.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 41ms (Views: 34.6ms | ActiveRecord: 5.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (7.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 59ms (Views: 47.1ms | ActiveRecord: 7.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (3.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 39ms (Views: 25.0ms | ActiveRecord: 3.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (5.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 12:26:24.353065' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 14.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 12:26:24 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 12:26:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (6.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 12:26:24.525427' WHERE "disclaimer_segments"."id" = 1  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (11.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:26:24.633597' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 12:26:24.689586' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (2.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (12.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 12:26:24 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 12:26:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 37ms (ActiveRecord: 12.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 38ms (Views: 27.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (8.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 27ms (ActiveRecord: 8.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 32.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (7.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 52ms (Views: 43.4ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 14ms (Views: 12.4ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (4.7ms) Completed 200 OK in 50ms (Views: 46.0ms | ActiveRecord: 1.0ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.8ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (4.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 12:26:25.349082' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 24ms (ActiveRecord: 4.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 113ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 14ms (Views: 12.7ms | ActiveRecord: 0.0ms)  (3.9ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:27:06', '2012-10-26 12:27:06') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:27:06', '2012-10-26 12:27:06', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:27:06', '2012-10-26 12:27:06', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:27:06', '2012-10-26 12:27:06') Fixture Insert (0.4ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:27:06', '2012-10-26 12:27:06')  (458.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 49ms (ActiveRecord: 1.2ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 84ms (Views: 83.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (2.3ms) begin transaction Fixture Delete (6.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:28:14', '2012-10-26 12:28:14') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:28:14', '2012-10-26 12:28:14', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:28:14', '2012-10-26 12:28:14', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:28:14', '2012-10-26 12:28:14') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:28:14', '2012-10-26 12:28:14')  (502.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 57ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 84ms (Views: 83.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (9.5ms) begin transaction Fixture Delete (5.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:28:37', '2012-10-26 12:28:37') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:28:37', '2012-10-26 12:28:37', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:28:37', '2012-10-26 12:28:37', 298486374) Fixture Delete (2.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:28:37', '2012-10-26 12:28:37') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:28:37', '2012-10-26 12:28:37')  (214.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 63ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 92ms (Views: 91.6ms | ActiveRecord: 0.0ms)  (0.5ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (7.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:29:22', '2012-10-26 12:29:22') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:29:22', '2012-10-26 12:29:22', 980190962) Fixture Insert (0.9ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:29:22', '2012-10-26 12:29:22', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:29:22', '2012-10-26 12:29:22') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:29:22', '2012-10-26 12:29:22')  (255.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 85ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 108ms (Views: 107.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:30:29', '2012-10-26 12:30:29') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:30:30', '2012-10-26 12:30:30', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:30:30', '2012-10-26 12:30:30', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:30:30', '2012-10-26 12:30:30') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:30:30', '2012-10-26 12:30:30')  (501.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 50ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 93ms (Views: 91.5ms | ActiveRecord: 0.0ms)  (0.5ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (7.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:31:12', '2012-10-26 12:31:12') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:31:12', '2012-10-26 12:31:12', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:31:12', '2012-10-26 12:31:12', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:31:12', '2012-10-26 12:31:12') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:31:12', '2012-10-26 12:31:12')  (198.5ms) commit transaction  (1.5ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 73ms (ActiveRecord: 0.2ms)  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 86ms (Views: 86.0ms | ActiveRecord: 0.0ms)  (0.6ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.5ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:31:47', '2012-10-26 12:31:47') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:31:47', '2012-10-26 12:31:47', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:31:47', '2012-10-26 12:31:47', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:31:47', '2012-10-26 12:31:47') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:31:47', '2012-10-26 12:31:47')  (181.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 165ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 143ms (Views: 142.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (9.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:33:18', '2012-10-26 12:33:18') Fixture Delete (1.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:33:18', '2012-10-26 12:33:18', 980190962) Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:33:18', '2012-10-26 12:33:18', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:33:18', '2012-10-26 12:33:18') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:33:18', '2012-10-26 12:33:18')  (551.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 51ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 77ms (Views: 76.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (8.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:37:29', '2012-10-26 12:37:29') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:37:29', '2012-10-26 12:37:29', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:37:29', '2012-10-26 12:37:29', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.0ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:37:29', '2012-10-26 12:37:29') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:37:29', '2012-10-26 12:37:29')  (173.6ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (15.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 94ms (ActiveRecord: 15.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 120ms (Views: 119.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (10.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.4ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:38:03', '2012-10-26 12:38:03') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:38:03', '2012-10-26 12:38:03', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:38:03', '2012-10-26 12:38:03', 298486374) Fixture Delete (1.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:38:03', '2012-10-26 12:38:03') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:38:03', '2012-10-26 12:38:03')  (218.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 500 Internal Server Error in 9ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 116ms (Views: 115.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (4.8ms) begin transaction Fixture Delete (8.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (7.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:38:29', '2012-10-26 12:38:29') Fixture Delete (3.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:38:30', '2012-10-26 12:38:30', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:38:30', '2012-10-26 12:38:30', 298486374) Fixture Delete (2.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (3.5ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:38:30', '2012-10-26 12:38:30') Fixture Insert (1.8ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:38:30', '2012-10-26 12:38:30')  (183.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 500 Internal Server Error in 1ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 113ms (Views: 112.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (7.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:39:14', '2012-10-26 12:39:14') Fixture Delete (1.4ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:39:14', '2012-10-26 12:39:14', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:39:14', '2012-10-26 12:39:14', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:39:14', '2012-10-26 12:39:14') Fixture Insert (0.0ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:39:14', '2012-10-26 12:39:14')  (174.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 182ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 107ms (Views: 106.7ms | ActiveRecord: 0.0ms)  (1.6ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (9.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:39:56', '2012-10-26 12:39:56') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:39:56', '2012-10-26 12:39:56', 980190962) Fixture Insert (1.7ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:39:56', '2012-10-26 12:39:56', 298486374) Fixture Delete (1.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:39:56', '2012-10-26 12:39:56') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:39:56', '2012-10-26 12:39:56')  (161.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 152ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (2.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 112ms (Views: 110.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:41:00', '2012-10-26 12:41:00') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:41:00', '2012-10-26 12:41:00', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:41:00', '2012-10-26 12:41:00', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:41:00', '2012-10-26 12:41:00') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:41:00', '2012-10-26 12:41:00')  (189.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 100ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 80ms (Views: 79.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (6.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:41:40', '2012-10-26 12:41:40') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.7ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:41:40', '2012-10-26 12:41:40', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:41:40', '2012-10-26 12:41:40', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:41:40', '2012-10-26 12:41:40') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:41:40', '2012-10-26 12:41:40')  (194.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 71ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 88ms (Views: 87.5ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:42:45', '2012-10-26 12:42:45') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:42:45', '2012-10-26 12:42:45', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:42:45', '2012-10-26 12:42:45', 298486374) Fixture Delete (1.2ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:42:45', '2012-10-26 12:42:45') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:42:45', '2012-10-26 12:42:45')  (170.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 190ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 129ms (Views: 128.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:44:42', '2012-10-26 12:44:42') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:44:42', '2012-10-26 12:44:42', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:44:42', '2012-10-26 12:44:42', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:44:42', '2012-10-26 12:44:42') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:44:42', '2012-10-26 12:44:42')  (216.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 111ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 134ms (Views: 134.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (6.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 12:48:23', '2012-10-26 12:48:23') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 12:48:23', '2012-10-26 12:48:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 12:48:23', '2012-10-26 12:48:23', 298486374) Fixture Delete (1.3ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 12:48:23', '2012-10-26 12:48:23') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 12:48:23', '2012-10-26 12:48:23')  (259.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 79ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 131ms (Views: 129.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.2ms) begin transaction Fixture Delete (7.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.2ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 13:10:16', '2012-10-26 13:10:16') Fixture Delete (1.2ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 13:10:16', '2012-10-26 13:10:16', 980190962) Fixture Insert (0.3ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 13:10:16', '2012-10-26 13:10:16', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 13:10:16', '2012-10-26 13:10:16') Fixture Insert (0.0ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 13:10:16', '2012-10-26 13:10:16')  (199.1ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 84ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 122ms (Views: 121.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (7.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.4ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 13:11:55', '2012-10-26 13:11:55') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 13:11:55', '2012-10-26 13:11:55', 980190962) Fixture Insert (0.8ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 13:11:55', '2012-10-26 13:11:55', 298486374) Fixture Delete (13.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 13:11:55', '2012-10-26 13:11:55') Fixture Insert (0.3ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 13:11:55', '2012-10-26 13:11:55')  (188.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 225ms (ActiveRecord: 0.1ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 168ms (Views: 167.4ms | ActiveRecord: 0.0ms)  (0.8ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.2ms) begin transaction Fixture Delete (5.6ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 13:13:11', '2012-10-26 13:13:11') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 13:13:11', '2012-10-26 13:13:11', 980190962) Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 13:13:11', '2012-10-26 13:13:11', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 13:13:11', '2012-10-26 13:13:11') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 13:13:11', '2012-10-26 13:13:11')  (487.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 77ms (ActiveRecord: 0.2ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 94ms (Views: 94.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (9.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 13:13:31', '2012-10-26 13:13:31') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.9ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 13:13:31', '2012-10-26 13:13:31', 980190962) Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 13:13:31', '2012-10-26 13:13:31', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 13:13:31', '2012-10-26 13:13:31') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 13:13:31', '2012-10-26 13:13:31')  (172.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 114ms (ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 80ms (Views: 80.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.7ms) begin transaction Fixture Delete (5.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (3.5ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 13:24:43', '2012-10-26 13:24:43') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 13:24:43', '2012-10-26 13:24:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 13:24:43', '2012-10-26 13:24:43', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 13:24:43', '2012-10-26 13:24:43') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 13:24:43', '2012-10-26 13:24:43')  (218.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (3.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 13:24:43.770369' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (1.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.9ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 129ms (ActiveRecord: 5.0ms) Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 57ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (5.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 13:24:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 18ms (ActiveRecord: 6.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 131ms (Views: 126.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (1.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (1.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 57ms (Views: 48.7ms | ActiveRecord: 2.6ms)  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 28ms (Views: 22.9ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 32ms (Views: 29.3ms | ActiveRecord: 0.9ms)  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 102ms (Views: 11.8ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 13:24:45.377491' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 3.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:24:45 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:24:45 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 13:24:45.554387' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 13:24:45.653062' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 13:24:45.762210' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.2ms) SAVEPOINT active_record_1 SQL (3.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 13:24:45 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 13:24:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 15ms (ActiveRecord: 3.7ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 28ms (Views: 23.9ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.8ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 13ms (ActiveRecord: 2.3ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.8ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 20.3ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 31ms (Views: 27.6ms | ActiveRecord: 1.1ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 15ms (Views: 13.1ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 31ms (Views: 26.6ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 13:24:46.396610' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 17ms (ActiveRecord: 2.3ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.4ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 22ms (ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 13ms (Views: 9.2ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (5.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (6.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 13:31:46', '2012-10-26 13:31:46') Fixture Delete (0.9ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 13:31:46', '2012-10-26 13:31:46', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 13:31:46', '2012-10-26 13:31:46', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 13:31:46', '2012-10-26 13:31:46') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 13:31:46', '2012-10-26 13:31:46')  (173.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.7ms) SAVEPOINT active_record_1  (10.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 13:31:46.276442' WHERE "disclaimer_documents"."id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (1.7ms) begin transaction Disclaimer::Document Load (9.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (9.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 9.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (6.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 231ms (ActiveRecord: 14.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 5.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (17.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 236ms (ActiveRecord: 19.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (3.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (5.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 33ms (ActiveRecord: 9.4ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 23ms (ActiveRecord: 7.3ms) Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (14.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00]] Disclaimer::SegmentHolder Load (10.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 76ms (ActiveRecord: 25.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (1.3ms) SAVEPOINT active_record_1 SQL (12.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 13:31:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 42ms (ActiveRecord: 13.9ms)  (0.0ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (8.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 194ms (Views: 184.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (14.6ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 46ms (ActiveRecord: 15.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (6.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 87ms (Views: 76.5ms | ActiveRecord: 4.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 51ms (Views: 40.3ms | ActiveRecord: 1.5ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 55ms (Views: 54.5ms | ActiveRecord: 0.5ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 43ms (Views: 37.2ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.7ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (5.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 13:31:48.435086' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 11.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 5.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (10.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (1.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:31:48 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:31:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 13:31:48.621289' WHERE "disclaimer_segments"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 13:31:48.729596' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (7.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 13:31:48.837056' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.8ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (8.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 13:31:48 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 13:31:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 36ms (ActiveRecord: 8.6ms)  (8.6ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 45ms (Views: 36.7ms | ActiveRecord: 1.7ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 25ms (ActiveRecord: 7.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (3.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 50ms (Views: 37.0ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (6.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 54ms (Views: 46.3ms | ActiveRecord: 2.0ms) Disclaimer::Segment Load (3.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 17ms (Views: 16.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (6.7ms) Completed 200 OK in 54ms (Views: 41.3ms | ActiveRecord: 1.3ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (11.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 13:31:49.506774' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 41ms (ActiveRecord: 11.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.3ms) rollback transaction  (0.1ms) begin transaction  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 174ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 500 Internal Server Error in 8ms  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.4ms) begin transaction Fixture Delete (10.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (7.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 13:32:54', '2012-10-26 13:32:54') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 13:32:54', '2012-10-26 13:32:54', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 13:32:54', '2012-10-26 13:32:54', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 13:32:54', '2012-10-26 13:32:54') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 13:32:54', '2012-10-26 13:32:54')  (272.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (5.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 13:32:55.074459' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 0.2ms)  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (4.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 247ms (ActiveRecord: 12.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 7.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 226ms (ActiveRecord: 8.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (4.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (3.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (4.8ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 8.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 27ms (ActiveRecord: 8.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (9.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00]] Disclaimer::SegmentHolder Load (2.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 55ms (ActiveRecord: 12.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 13:32:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 29ms (ActiveRecord: 6.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (3.2ms) rollback transaction  (5.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 179ms (Views: 173.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (4.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 19ms (ActiveRecord: 5.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 81ms (Views: 72.4ms | ActiveRecord: 1.0ms)  (6.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 43ms (Views: 33.6ms | ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 57ms (Views: 56.1ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (7.6ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 46ms (Views: 27.8ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (11.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 13:32:57.121484' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 50ms (ActiveRecord: 16.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (2.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 13:32:57 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 13:32:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (9.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 13:32:57.336341' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 13:32:57.465559' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (1.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (11.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 13:32:57.574805' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.0ms) SAVEPOINT active_record_1 SQL (11.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 13:32:57 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 13:32:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 35ms (ActiveRecord: 11.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 37ms (Views: 32.2ms | ActiveRecord: 1.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (4.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 31ms (ActiveRecord: 4.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 37ms (Views: 28.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 58ms (Views: 50.0ms | ActiveRecord: 0.4ms) Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 22ms (Views: 21.0ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 68ms (Views: 60.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.4ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (10.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 13:32:58.215589' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 46ms (ActiveRecord: 10.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (3.8ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 176ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 16ms (Views: 10.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.0ms) begin transaction Fixture Delete (8.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (4.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 14:22:19', '2012-10-26 14:22:19') Fixture Delete (6.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 14:22:19', '2012-10-26 14:22:19', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 14:22:19', '2012-10-26 14:22:19', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 14:22:19', '2012-10-26 14:22:19') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 14:22:19', '2012-10-26 14:22:19')  (170.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (11.2ms) SAVEPOINT active_record_1  (6.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 14:22:19.747336' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.2ms) rollback transaction  (3.4ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (6.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 19ms (ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 192ms (ActiveRecord: 6.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (11.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 12.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (3.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (8.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:22:20 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 14:22:20 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:22:20 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 14:22:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 225ms (ActiveRecord: 10.1ms) Disclaimer::Document Load (1.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (2.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 3.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 8.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (10.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:22:21 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 14:22:21 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:22:21 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 14:22:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 71ms (ActiveRecord: 11.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (3.0ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.4ms) SAVEPOINT active_record_1 SQL (12.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:22:21 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 14:22:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 39ms (ActiveRecord: 12.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 216ms (Views: 210.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 25ms (ActiveRecord: 5.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (6.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 98ms (Views: 84.9ms | ActiveRecord: 7.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (2.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 57ms (Views: 42.7ms | ActiveRecord: 2.9ms) Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (7.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 61ms (Views: 53.0ms | ActiveRecord: 8.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 42ms (Views: 32.1ms | ActiveRecord: 3.4ms)  (3.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (5.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (8.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (7.2ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 14:22:22.027439' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 46ms (ActiveRecord: 22.9ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (9.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 22ms (ActiveRecord: 4.4ms) Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (7.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:22:22 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 14:22:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (11.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 14:22:22.271193' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (3.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (3.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (1.4ms) SAVEPOINT active_record_1 SQL (5.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (4.7ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 14:22:22.397555' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (6.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (7.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 14:22:22.500646' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.8ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (3.7ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (8.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 14:22:22 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 14:22:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 39ms (ActiveRecord: 8.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 42ms (Views: 35.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (6.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (2.8ms) SAVEPOINT active_record_1 SQL (9.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 35ms (ActiveRecord: 19.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (2.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 42ms (Views: 30.6ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 60ms (Views: 55.1ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 27ms (Views: 24.4ms | ActiveRecord: 0.0ms)  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (2.8ms) Completed 200 OK in 61ms (Views: 54.6ms | ActiveRecord: 0.0ms)  (9.4ms) rollback transaction  (6.2ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (3.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 14:22:23.226700' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 22ms (ActiveRecord: 3.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 200ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 12ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (1.9ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 11ms (Views: 10.9ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2012-10-26 14:25:59', '2012-10-26 14:25:59') Fixture Delete (2.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2012-10-26 14:25:59', '2012-10-26 14:25:59', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2012-10-26 14:25:59', '2012-10-26 14:25:59', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2012-10-26 14:25:59', '2012-10-26 14:25:59') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2012-10-26 14:25:59', '2012-10-26 14:25:59')  (237.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (8.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.1ms) SAVEPOINT active_record_1  (3.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 14:26:00.097489' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (3.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (5.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (11.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 268ms (ActiveRecord: 12.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 6.5ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (4.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 207ms (ActiveRecord: 13.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 54ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (1.7ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 33ms (ActiveRecord: 13.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 2.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (8.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (7.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 26 Oct 2012 14:26:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 36ms (ActiveRecord: 7.8ms)  (2.9ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (4.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 173ms (Views: 165.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (7.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 31ms (ActiveRecord: 7.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (20.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (8.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 84ms (Views: 68.4ms | ActiveRecord: 9.7ms)  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (3.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 49ms (Views: 33.8ms | ActiveRecord: 3.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (6.6ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 70ms (Views: 61.6ms | ActiveRecord: 6.9ms)  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (4.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (4.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 40ms (Views: 25.5ms | ActiveRecord: 9.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (6.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (4.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2012-10-26 14:26:02.238444' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 15.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (3.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (4.0ms) rollback transaction  (3.5ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (1.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (7.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 9.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (4.2ms) rollback transaction  (5.8ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (6.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 26 Oct 2012 14:26:02 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 26 Oct 2012 14:26:02 UTC +00:00]]  (3.3ms) RELEASE SAVEPOINT active_record_1  (3.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (5.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2012-10-26 14:26:02.481624' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (5.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (4.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (3.0ms) SAVEPOINT active_record_1 SQL (4.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (2.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 14:26:02.610277' WHERE "disclaimer_segment_holders"."id" = 980190962  (1.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (1.2ms) SAVEPOINT active_record_1 SQL (10.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (1.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (5.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2012-10-26 14:26:02.745311' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (3.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (11.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 26 Oct 2012 14:26:02 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 26 Oct 2012 14:26:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 28ms (ActiveRecord: 11.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (6.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 39ms (Views: 31.5ms | ActiveRecord: 0.2ms)  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (8.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 31ms (ActiveRecord: 8.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 41ms (Views: 36.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 64ms (Views: 58.4ms | ActiveRecord: 0.9ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (6.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 22ms (Views: 18.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 62ms (Views: 50.3ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (3.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (3.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2012-10-26 14:26:03.416213' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 25ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) rollback transaction  (0.1ms) begin transaction  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 189ms (Views: 184.5ms | ActiveRecord: 0.0ms)  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 28ms (ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 9ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (2.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (5.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:15:21', '2013-01-21 16:15:21') Fixture Delete (3.3ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:15:21', '2013-01-21 16:15:21', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:15:21', '2013-01-21 16:15:21', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (1.3ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:15:21', '2013-01-21 16:15:21') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:15:21', '2013-01-21 16:15:21')  (492.5ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:15:22.339189' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 15ms (ActiveRecord: 0.8ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 146ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 18ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 46ms (ActiveRecord: 5.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (3.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:15:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 20ms (ActiveRecord: 3.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 384ms (Views: 379.0ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 1.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 85ms (Views: 77.9ms | ActiveRecord: 1.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 26ms (Views: 20.4ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 26ms (Views: 23.8ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 96ms (Views: 11.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (7.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (5.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:15:24.897236' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 13.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 3.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:15:25 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:15:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:15:25.233294' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:15:25.336489' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.5ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:15:25.443787' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (1.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (2.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.2ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:15:25 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:15:25 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 13ms (ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 27ms (Views: 23.1ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 14ms (ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 17.2ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 35ms (Views: 30.1ms | ActiveRecord: 1.3ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 14ms (Views: 13.1ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (4.2ms) Completed 200 OK in 50ms (Views: 46.3ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.6ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:15:26.055985' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 14ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.4ms) begin transaction  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 15ms (Views: 14.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 25ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:16:02', '2013-01-21 16:16:02') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:16:02', '2013-01-21 16:16:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:16:02', '2013-01-21 16:16:02', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:16:02', '2013-01-21 16:16:02') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:16:02', '2013-01-21 16:16:02')  (268.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (4.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (2.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:16:03.017643' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 108ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 60ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (5.4ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:16:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 20ms (ActiveRecord: 5.7ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.9ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 145ms (Views: 139.1ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (1.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 46ms (Views: 40.7ms | ActiveRecord: 1.1ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 24ms (Views: 18.2ms | ActiveRecord: 1.2ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 31ms (Views: 28.4ms | ActiveRecord: 0.9ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 106ms (Views: 10.9ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:16:04.656689' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:04 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:16:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:16:04.808765' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:16:04.911905' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:16:05.104625' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (2.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (4.2ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:16:05 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:16:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 17ms (ActiveRecord: 2.4ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 19.9ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 13ms (ActiveRecord: 1.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (2.0ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 17.0ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 30ms (Views: 26.6ms | ActiveRecord: 0.9ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 28ms (Views: 26.6ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (3.9ms) Completed 200 OK in 61ms (Views: 57.0ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:16:05.899021' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 25ms (ActiveRecord: 5.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.4ms) begin transaction  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 11ms (Views: 9.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 19ms (ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:16:39', '2013-01-21 16:16:39') Fixture Delete (1.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:16:39', '2013-01-21 16:16:39', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:16:39', '2013-01-21 16:16:39', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:16:39', '2013-01-21 16:16:39') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:16:39', '2013-01-21 16:16:39')  (241.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:16:39.488680' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 109ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 65ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:16:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 18ms (ActiveRecord: 4.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 111ms (Views: 106.3ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 43ms (Views: 38.1ms | ActiveRecord: 1.4ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 23ms (Views: 18.4ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 29ms (Views: 26.0ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 141ms (Views: 19.0ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.3ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:16:41.114025' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 3.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:16:41 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:16:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:16:41.272010' WHERE "disclaimer_segments"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:16:41.372635' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:16:41.467184' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (2.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:16:41 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:16:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 16ms (ActiveRecord: 2.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 35ms (Views: 22.2ms | ActiveRecord: 0.3ms)  (0.4ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 13ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 17.1ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 28ms (Views: 24.8ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 17ms (Views: 15.1ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (4.2ms) Completed 200 OK in 33ms (Views: 29.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (1.5ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:16:42.070490' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 17ms (ActiveRecord: 3.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.4ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 19ms (Views: 17.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 28ms (ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:17:42', '2013-01-21 16:17:42') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:17:43', '2013-01-21 16:17:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:17:43', '2013-01-21 16:17:43', 298486374) Fixture Delete (2.4ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:17:43', '2013-01-21 16:17:43') Fixture Insert (4.3ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:17:43', '2013-01-21 16:17:43')  (251.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:17:43.308231' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 109ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:17:43 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:17:43 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:17:43 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:17:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 66ms (ActiveRecord: 2.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.4ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:17:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:17:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:17:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:17:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (5.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:17:44 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:17:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 27ms (ActiveRecord: 5.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 113ms (Views: 108.3ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (6.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 19ms (ActiveRecord: 7.6ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 72ms (Views: 66.7ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 27ms (Views: 20.8ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 107ms (Views: 104.5ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 27ms (Views: 19.8ms | ActiveRecord: 0.9ms)  (0.2ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (2.9ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (3.2ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:17:44.981259' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 23ms (ActiveRecord: 5.9ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.2ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:17:45 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:17:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:17:45.157929' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:17:45.270751' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:17:45.361834' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:17:45 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:17:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 18.5ms | ActiveRecord: 0.3ms)  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (4.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 19ms (ActiveRecord: 6.5ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.9ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 22.1ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 27ms (Views: 23.8ms | ActiveRecord: 1.2ms) Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (2.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 34ms (Views: 32.3ms | ActiveRecord: 0.0ms)  (0.3ms) rollback transaction  (5.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 44ms (Views: 30.6ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:17:46.108876' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 16ms (ActiveRecord: 1.7ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (1.0ms) begin transaction  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 13ms (Views: 11.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 18ms (ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:18:46', '2013-01-21 16:18:46') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:18:46', '2013-01-21 16:18:46', 980190962) Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:18:46', '2013-01-21 16:18:46', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:18:46', '2013-01-21 16:18:46') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:18:46', '2013-01-21 16:18:46')  (222.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (2.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:18:46.775547' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 117ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 65ms (ActiveRecord: 3.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 18ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (3.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:18:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 17ms (ActiveRecord: 4.1ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 120ms (Views: 115.0ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 4.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 47ms (Views: 41.5ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 21ms (Views: 17.5ms | ActiveRecord: 0.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 106ms (Views: 102.1ms | ActiveRecord: 2.3ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 39ms (Views: 27.3ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.7ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:18:48.429489' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:18:48 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:18:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (2.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:18:48.581525' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (2.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:18:48.672195' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:18:48.780884' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:18:49 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:18:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 21ms (ActiveRecord: 3.0ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.5ms) rollback transaction  (11.4ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 46.1ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 14ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 17.3ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 38ms (Views: 34.2ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 19ms (Views: 17.7ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.1ms) Completed 200 OK in 33ms (Views: 29.6ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:18:49.639928' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 14ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 19ms (ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (3.8ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:19:50', '2013-01-21 16:19:50') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:19:50', '2013-01-21 16:19:50', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:19:50', '2013-01-21 16:19:50', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:19:50', '2013-01-21 16:19:50') Fixture Insert (7.4ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:19:50', '2013-01-21 16:19:50')  (186.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:19:50.246046' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 114ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:19:50 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:19:50 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:19:50 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:19:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 2.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:19:50 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:19:50 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:19:51 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:19:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 3.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (10.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:19:51 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:19:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 22ms (ActiveRecord: 10.4ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 120ms (Views: 112.2ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 5.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 46ms (Views: 40.2ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 25ms (Views: 21.5ms | ActiveRecord: 0.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 105ms (Views: 101.0ms | ActiveRecord: 2.1ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 24ms (Views: 18.8ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:19:51.860685' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 4.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:19:51 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:19:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:19:52.015752' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:19:52.106774' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:19:52.215181' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (7.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:19:52 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:19:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 19ms (ActiveRecord: 4.2ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 16.9ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 13ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 20.2ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 29ms (Views: 26.0ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 22ms (Views: 19.7ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.2ms) Completed 200 OK in 34ms (Views: 29.9ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (2.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:19:52.986502' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 12ms (ActiveRecord: 2.6ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.4ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 11ms (Views: 10.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 16ms (ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 6ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.3ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:21:00', '2013-01-21 16:21:00') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:21:00', '2013-01-21 16:21:00', 980190962) Fixture Insert (1.0ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:21:00', '2013-01-21 16:21:00', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:21:00', '2013-01-21 16:21:00') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:21:00', '2013-01-21 16:21:00')  (213.7ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (6.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:21:00.728503' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (1.9ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 107ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 66ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (3.1ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:21:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 23ms (ActiveRecord: 3.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 117ms (Views: 113.1ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 55ms (Views: 49.1ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 28ms (Views: 24.6ms | ActiveRecord: 0.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (1.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (97.6ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 125ms (Views: 25.0ms | ActiveRecord: 98.9ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 24ms (Views: 18.1ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:21:02.383234' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 18ms (ActiveRecord: 6.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:21:02 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:21:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:21:02.532819' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:21:02.621974' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:21:02.790693' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:21:03 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:21:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 15ms (ActiveRecord: 4.3ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 20.9ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (1.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 11ms (ActiveRecord: 1.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (2.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 17.7ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 29ms (Views: 25.2ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 21ms (Views: 20.0ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 30ms (Views: 25.5ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:21:03.477787' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 14ms (ActiveRecord: 1.4ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.4ms) begin transaction  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 11ms (Views: 9.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 15ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 14ms (Views: 14.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:22:38', '2013-01-21 16:22:38') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:22:38', '2013-01-21 16:22:38', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:22:38', '2013-01-21 16:22:38', 298486374) Fixture Delete (6.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:22:38', '2013-01-21 16:22:38') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:22:38', '2013-01-21 16:22:38')  (266.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:22:39.309664' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 108ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:22:39 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:22:39 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:22:39 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:22:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 63ms (ActiveRecord: 3.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.8ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:22:40 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:22:40 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:22:40 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:22:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (3.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:22:40 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:22:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 18ms (ActiveRecord: 3.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 113ms (Views: 108.1ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 12ms (ActiveRecord: 1.4ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 49ms (Views: 39.0ms | ActiveRecord: 1.1ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 25ms (Views: 21.2ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 119ms (Views: 115.8ms | ActiveRecord: 1.9ms)  (0.2ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 30ms (Views: 25.9ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (3.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.9ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:22:40.933441' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:22:41 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:22:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:22:41.090720' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:22:41.177996' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.4ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:22:41.277391' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:22:41 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:22:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 17ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 17.0ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 11ms (ActiveRecord: 1.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 29ms (Views: 24.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 27ms (Views: 23.4ms | ActiveRecord: 0.9ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 19ms (Views: 18.0ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.6ms) Completed 200 OK in 31ms (Views: 27.5ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (5.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:22:41.891338' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 22ms (ActiveRecord: 6.3ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 14ms (Views: 12.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 17ms (ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:24:57', '2013-01-21 16:24:57') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:24:57', '2013-01-21 16:24:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:24:57', '2013-01-21 16:24:57', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:24:57', '2013-01-21 16:24:57') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:24:57', '2013-01-21 16:24:57')  (238.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:24:57.926737' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 115ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 18ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 67ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.3ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:24:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 18ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 121ms (Views: 115.3ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (5.9ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.6ms) rollback transaction  (2.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 44ms (Views: 38.8ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 23ms (Views: 19.1ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (1.8ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 110ms (Views: 107.2ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 28ms (Views: 23.7ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:24:59.525746' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (1.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 3.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (1.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:24:59 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:24:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:24:59.671748' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.0ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:24:59.761227' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (12.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:24:59.930972' WHERE "disclaimer_segment_holders"."id" = 980190962  (1.5ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:25:00 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:25:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 20ms (ActiveRecord: 6.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 17.2ms | ActiveRecord: 0.3ms)  (2.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 16ms (ActiveRecord: 1.6ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 18.9ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 26ms (Views: 23.1ms | ActiveRecord: 0.8ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 31ms (Views: 25.8ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 31ms (Views: 27.0ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (7.7ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:25:00.594766' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 26ms (ActiveRecord: 8.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.4ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 20ms (ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 9ms (Views: 9.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:34:32', '2013-01-21 16:34:32') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:34:32', '2013-01-21 16:34:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:34:32', '2013-01-21 16:34:32', 298486374) Fixture Delete (8.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.4ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:34:32', '2013-01-21 16:34:32') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:34:32', '2013-01-21 16:34:32')  (256.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:34:33.234966' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 112ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:34:33 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:34:33 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:34:33 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:34:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 43ms (ActiveRecord: 4.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 3.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (2.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 16ms (ActiveRecord: 2.6ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 121ms (Views: 116.5ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 60ms (Views: 53.8ms | ActiveRecord: 1.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 25ms (Views: 20.0ms | ActiveRecord: 0.8ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 108ms (Views: 105.8ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 20ms (Views: 15.2ms | ActiveRecord: 0.9ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:34:34.752679' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:34:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:34:34.909819' WHERE "disclaimer_segments"."id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (1.9ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:34:35.005039' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.3ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:34:35.095241' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (2.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (3.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:34:35 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:34:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 21ms (ActiveRecord: 3.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 41.7ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 16ms (ActiveRecord: 2.3ms)  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segments"  (1.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 17.2ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 29ms (Views: 24.9ms | ActiveRecord: 1.2ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 25ms (Views: 23.7ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.0ms) Completed 200 OK in 32ms (Views: 29.5ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:34:35.894020' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 13ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.4ms) begin transaction  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 11ms (Views: 10.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 18ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:35:00', '2013-01-21 16:35:00') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:35:00', '2013-01-21 16:35:00', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:35:00', '2013-01-21 16:35:00', 298486374) Fixture Delete (8.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:35:00', '2013-01-21 16:35:00') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:35:00', '2013-01-21 16:35:00')  (183.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (6.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:35:00.545591' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 110ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 2.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:35:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 13ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 115ms (Views: 109.8ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 14ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.7ms) rollback transaction  (5.7ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 55ms (Views: 46.4ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 23ms (Views: 19.0ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 103ms (Views: 100.7ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 23ms (Views: 16.2ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:35:02.024789' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 6.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:35:02 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:35:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:35:02.185005' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (3.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:35:02.277806' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:35:02.366237' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:35:02 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:35:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 2.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 27ms (Views: 20.6ms | ActiveRecord: 0.8ms)  (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 20ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 42ms (Views: 32.0ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 38ms (Views: 34.2ms | ActiveRecord: 1.3ms) Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 22ms (Views: 20.2ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 36ms (Views: 32.3ms | ActiveRecord: 0.9ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:35:03.159457' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 13ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 13ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 16ms (ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:56:53', '2013-01-21 16:56:53') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:56:53', '2013-01-21 16:56:53', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:56:53', '2013-01-21 16:56:53', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:56:53', '2013-01-21 16:56:53') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:56:53', '2013-01-21 16:56:53')  (202.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:56:53.952172' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 111ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 3.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (1.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:56:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 22ms (ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 125ms (Views: 117.5ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 46ms (Views: 40.7ms | ActiveRecord: 1.2ms)  (0.2ms) rollback transaction  (0.8ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 21ms (Views: 15.9ms | ActiveRecord: 0.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.7ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 123ms (Views: 120.2ms | ActiveRecord: 1.3ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 26ms (Views: 21.9ms | ActiveRecord: 0.8ms)  (0.3ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (3.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:56:55.484173' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 4.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:56:55 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:56:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:56:55.635780' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (2.0ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:56:55.730299' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (1.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.7ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:56:55.820913' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (5.5ms) rollback transaction  (2.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:56:55 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:56:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 2.1ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 16.8ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 12ms (ActiveRecord: 1.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 39ms (Views: 34.3ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 30ms (Views: 26.9ms | ActiveRecord: 0.9ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 19ms (Views: 17.3ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.3ms) Completed 200 OK in 29ms (Views: 25.0ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:56:56.452438' WHERE "disclaimer_segments"."id" = 1  (1.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 17ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.8ms) begin transaction  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 17ms (Views: 14.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 18ms (ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-21 16:57:48', '2013-01-21 16:57:48') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-21 16:57:48', '2013-01-21 16:57:48', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-21 16:57:48', '2013-01-21 16:57:48', 298486374) Fixture Delete (10.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-21 16:57:48', '2013-01-21 16:57:48') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-21 16:57:48', '2013-01-21 16:57:48')  (198.9ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:57:49.117977' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (1.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 115ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 38ms (ActiveRecord: 2.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (6.6ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 7.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (2.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Mon, 21 Jan 2013 16:57:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 15ms (ActiveRecord: 2.6ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 122ms (Views: 117.3ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 16ms (ActiveRecord: 1.4ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 46ms (Views: 39.8ms | ActiveRecord: 1.8ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 25ms (Views: 18.1ms | ActiveRecord: 1.9ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (1.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 100ms (Views: 96.7ms | ActiveRecord: 1.9ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 21ms (Views: 17.1ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-21 16:57:50.583821' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (1.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Mon, 21 Jan 2013 16:57:50 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Mon, 21 Jan 2013 16:57:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-21 16:57:50.758846' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.7ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:57:50.849886' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-21 16:57:50.941498' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (4.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (8.9ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Mon, 21 Jan 2013 16:57:51 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Mon, 21 Jan 2013 16:57:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 35ms (ActiveRecord: 9.2ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.7ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 35ms (Views: 29.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 11ms (ActiveRecord: 2.5ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 18.6ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 30ms (Views: 23.4ms | ActiveRecord: 2.0ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 20ms (Views: 18.2ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.9ms) Completed 200 OK in 42ms (Views: 35.3ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.5ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-21 16:57:51.727524' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 29ms (ActiveRecord: 0.8ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (5.2ms) rollback transaction  (0.4ms) begin transaction  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 16ms (Views: 15.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 16ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 6ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 08:19:42', '2013-01-22 08:19:42') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 08:19:42', '2013-01-22 08:19:42', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 08:19:42', '2013-01-22 08:19:42', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 08:19:42', '2013-01-22 08:19:42') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 08:19:42', '2013-01-22 08:19:42')  (238.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:19:42.996844' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Document Load (1.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 280ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (4.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (4.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 17ms (ActiveRecord: 5.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 63ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 4.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (2.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 08:19:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 18ms (ActiveRecord: 2.6ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (2.1ms) rollback transaction  (2.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 205ms (Views: 200.2ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 11ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 81ms (Views: 75.2ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 25ms (Views: 20.1ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 108ms (Views: 103.4ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 22ms (Views: 17.5ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.6ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 08:19:44.965932' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 21ms (ActiveRecord: 2.7ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (1.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:19:45 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:19:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:19:45.120429' WHERE "disclaimer_segments"."id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:19:45.217742' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.9ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:19:45.315866' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 08:19:45 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 08:19:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 20ms (ActiveRecord: 2.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (2.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 15.4ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 10ms (ActiveRecord: 1.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 16.2ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 31ms (Views: 28.0ms | ActiveRecord: 1.0ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 21ms (Views: 19.1ms | ActiveRecord: 0.0ms)  (0.3ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 81ms (Views: 77.4ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 08:19:45.964429' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 12ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.4ms) begin transaction  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.0ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 25ms (ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Connecting to database specified by database.yml  (1.7ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 08:40:23', '2013-01-22 08:40:23') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 08:40:23', '2013-01-22 08:40:23', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 08:40:23', '2013-01-22 08:40:23', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 08:40:23', '2013-01-22 08:40:23') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 08:40:23', '2013-01-22 08:40:23')  (264.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:40:23.541991' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 47ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00]]  (3.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 5.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 08:40:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 10ms (ActiveRecord: 1.7ms)  (2.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 52ms (Views: 50.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 9ms (ActiveRecord: 3.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 26ms (Views: 22.9ms | ActiveRecord: 1.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 11.0ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 6.9ms | ActiveRecord: 0.4ms)  (1.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 08:40:24.035344' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (5.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:40:24 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:40:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:40:24.090013' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:40:24.115737' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:40:24.141301' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 08:40:24 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 08:40:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (5.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 18.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 9.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 24ms (Views: 19.3ms | ActiveRecord: 0.7ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 8.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (3.2ms) Completed 200 OK in 23ms (Views: 20.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 08:40:24.381802' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.9ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)  (1.7ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (2.6ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 08:42:07', '2013-01-22 08:42:07') Fixture Delete (0.8ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 08:42:07', '2013-01-22 08:42:07', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 08:42:07', '2013-01-22 08:42:07', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 08:42:07', '2013-01-22 08:42:07') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 08:42:07', '2013-01-22 08:42:07')  (280.4ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (3.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:42:08.224202' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 28ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 48ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 48ms (Views: 44.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 22ms (Views: 20.2ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (2.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 15ms (Views: 13.5ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 8.4ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 08:42:08.711037' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:42:08.757897' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.6ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:42:08.790496' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (1.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:42:08.811178' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 08:42:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 7ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 6.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 11ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 16.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 21ms (Views: 19.8ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (5.5ms) Completed 200 OK in 28ms (Views: 25.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 08:42:09.044290' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (2.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 6ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 8ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 08:44:26', '2013-01-22 08:44:26') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 08:44:26', '2013-01-22 08:44:26', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 08:44:26', '2013-01-22 08:44:26', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 08:44:26', '2013-01-22 08:44:26') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 08:44:26', '2013-01-22 08:44:26')  (234.2ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (4.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:44:26.488355' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.7ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 08:44:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 50ms (Views: 47.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.3ms)  (0.7ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 22ms (Views: 20.4ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 6.5ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (1.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 9.1ms | ActiveRecord: 1.3ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 8.1ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 08:44:26.969262' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:27 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:44:27 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:44:27.012253' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:44:27.032596' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:44:27.059485' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 08:44:27 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 08:44:27 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 17ms (Views: 12.7ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 7.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 32ms (Views: 30.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 08:44:27.279995' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 7ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 08:44:46', '2013-01-22 08:44:46') Fixture Delete (1.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 08:44:46', '2013-01-22 08:44:46', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 08:44:46', '2013-01-22 08:44:46', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 08:44:46', '2013-01-22 08:44:46') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 08:44:46', '2013-01-22 08:44:46')  (222.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:44:46.391707' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 28ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 53ms (Views: 47.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 24ms (Views: 22.0ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.7ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 13ms (Views: 12.2ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 08:44:46.870413' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:44:46.920205' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:44:46.942873' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:44:46.963205' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 08:44:46 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 9ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 14ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 6.6ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 14ms (Views: 12.0ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.9ms) Completed 200 OK in 35ms (Views: 32.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 08:44:47.184989' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 39ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.2ms) begin transaction  (0.9ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 10ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 08:45:02', '2013-01-22 08:45:02') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 08:45:02', '2013-01-22 08:45:02', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 08:45:02', '2013-01-22 08:45:02', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.3ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 08:45:02', '2013-01-22 08:45:02') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 08:45:02', '2013-01-22 08:45:02')  (346.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:45:03.325851' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 31ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 3.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 47ms (Views: 44.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 3.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 24ms (Views: 19.7ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 6.5ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (2.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 11.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 8.8ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 08:45:03.774389' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 4.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 08:45:03.828476' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:45:03.853761' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 08:45:03.873269' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 08:45:03 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 8ms (Views: 6.6ms | ActiveRecord: 0.2ms)  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.8ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 11.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 28ms (Views: 26.4ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 11ms (Views: 10.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (4.6ms) Completed 200 OK in 24ms (Views: 21.2ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 08:45:04.103947' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 46ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 7ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 09:04:43', '2013-01-22 09:04:43') Fixture Delete (1.2ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 09:04:43', '2013-01-22 09:04:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 09:04:43', '2013-01-22 09:04:43', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 09:04:43', '2013-01-22 09:04:43') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 09:04:43', '2013-01-22 09:04:43')  (215.0ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:04:43.738782' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to Completed 500 Internal Server Error in 6ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 35ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:04:43 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:04:43 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:04:43 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:04:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 48ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.2ms) SAVEPOINT active_record_1 SQL (4.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 4.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 47ms (Views: 43.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to Completed 500 Internal Server Error in 5ms  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 25ms (Views: 22.5ms | ActiveRecord: 0.7ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Completed 500 Internal Server Error in 51ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 500 Internal Server Error in 8ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 10.7ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.8ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 09:04:44.271428' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 3.7ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:04:44.341757' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:04:44.368833' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (2.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (1.9ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:04:44.389360' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 09:04:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 9ms  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 11ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to Completed 500 Internal Server Error in 5ms  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 19ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Completed 500 Internal Server Error in 38ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 500 Internal Server Error in 18ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 18ms (Views: 13.3ms | ActiveRecord: 0.5ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 09:04:44.583967' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 8ms  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 6ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 09:05:48', '2013-01-22 09:05:48') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 09:05:48', '2013-01-22 09:05:48', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 09:05:48', '2013-01-22 09:05:48', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 09:05:48', '2013-01-22 09:05:48') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 09:05:48', '2013-01-22 09:05:48')  (196.1ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (2.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:05:48.344782' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to Completed 500 Internal Server Error in 4ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (8.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.9ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 63ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 53ms (Views: 51.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to Completed 500 Internal Server Error in 5ms  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 21ms (Views: 18.8ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Completed 500 Internal Server Error in 27ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 500 Internal Server Error in 12ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 6.3ms | ActiveRecord: 2.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 09:05:48.878576' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:05:48 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:05:48.950410' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:05:48.969686' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:05:48.990104' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (11.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 09:05:49 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 09:05:49 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 6ms  (7.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 17ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to Completed 500 Internal Server Error in 13ms  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 33ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Completed 500 Internal Server Error in 22ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 500 Internal Server Error in 17ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 15ms (Views: 14.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 09:05:49.259194' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 7ms  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 5ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 7ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (2.8ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 09:06:26', '2013-01-22 09:06:26') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 09:06:26', '2013-01-22 09:06:26', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 09:06:26', '2013-01-22 09:06:26', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 09:06:26', '2013-01-22 09:06:26') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 09:06:26', '2013-01-22 09:06:26')  (187.4ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.8ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:06:26.708331' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to Completed 500 Internal Server Error in 4ms  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 36ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 82ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (1.0ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 10ms (ActiveRecord: 2.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 47ms (Views: 44.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to Completed 500 Internal Server Error in 5ms  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 26ms (Views: 24.2ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Completed 500 Internal Server Error in 19ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Completed 500 Internal Server Error in 9ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 9.8ms | ActiveRecord: 0.5ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (6.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 09:06:27.258394' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 7.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 2.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:06:27.338153' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (2.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (4.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:06:27.371189' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.5ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:06:27.399315' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 09:06:27 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 8ms  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 16ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to Completed 500 Internal Server Error in 6ms  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 19ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Completed 500 Internal Server Error in 25ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 500 Internal Server Error in 12ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 17ms (Views: 10.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 09:06:27.589313' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Completed 500 Internal Server Error in 7ms  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 5ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.6ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 09:08:17', '2013-01-22 09:08:17') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 09:08:17', '2013-01-22 09:08:17', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 09:08:17', '2013-01-22 09:08:17', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 09:08:17', '2013-01-22 09:08:17') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 09:08:17', '2013-01-22 09:08:17')  (215.6ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:08:17.523893' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 48ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 09:08:17 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 53ms (Views: 49.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 22ms (Views: 19.8ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.2ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 09:08:17.999324' WHERE "disclaimer_documents"."id" = 1  (2.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 4.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:08:18 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:08:18 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:08:18.052242' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:08:18.073615' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (1.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:08:18.093590' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 09:08:18 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 09:08:18 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 13ms (Views: 11.5ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 22ms (Views: 20.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 09:08:18.311722' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 6ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-22 09:48:10', '2013-01-22 09:48:10') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-22 09:48:10', '2013-01-22 09:48:10', 980190962) Fixture Insert (4.6ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-22 09:48:10', '2013-01-22 09:48:10', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-22 09:48:10', '2013-01-22 09:48:10') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-22 09:48:10', '2013-01-22 09:48:10')  (281.0ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:48:10.930412' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 32ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (1.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 49ms (Views: 47.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 23ms (Views: 20.7ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.7ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (1.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 9.8ms | ActiveRecord: 1.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 8.7ms | ActiveRecord: 2.6ms)  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-22 09:48:11.404090' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-22 09:48:11.454419' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:48:11.473601' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-22 09:48:11.500584' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Tue, 22 Jan 2013 09:48:11 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 8ms (Views: 6.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 17ms (Views: 12.7ms | ActiveRecord: 0.8ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (5.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 15ms (Views: 14.7ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.8ms) Completed 200 OK in 38ms (Views: 36.5ms | ActiveRecord: 0.1ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-22 09:48:11.721402' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 5ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-24 10:07:05', '2013-01-24 10:07:05') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-24 10:07:05', '2013-01-24 10:07:05', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-24 10:07:05', '2013-01-24 10:07:05', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-24 10:07:05', '2013-01-24 10:07:05') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-24 10:07:05', '2013-01-24 10:07:05')  (431.8ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-24 10:07:06.362146' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 125ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 85ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 3.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 15ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.9ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 116ms (Views: 113.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 59ms (Views: 56.9ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.6ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 16ms (Views: 14.8ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 6.8ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-24 10:07:07.570434' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-24 10:07:07.617130' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (3.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-24 10:07:07.645501' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-24 10:07:07.671182' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 24 Jan 2013 10:07:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.5ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (2.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 8ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 8.7ms | ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 13ms (Views: 11.1ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 21ms (Views: 19.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-24 10:07:07.862200' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (2.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 39ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-01-24 10:13:17', '2013-01-24 10:13:17') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-01-24 10:13:17', '2013-01-24 10:13:17', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-01-24 10:13:17', '2013-01-24 10:13:17', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-01-24 10:13:17', '2013-01-24 10:13:17') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-01-24 10:13:17', '2013-01-24 10:13:17')  (164.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-24 10:13:17.358462' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (5.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 51ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 3.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00]] Disclaimer::SegmentHolder Load (26.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 46ms (ActiveRecord: 30.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 21.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 51ms (Views: 46.7ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.2ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 11.1ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-01-24 10:13:17.843746' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-01-24 10:13:17.891461' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-24 10:13:17.914093' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (1.1ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-01-24 10:13:17.938893' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Thu, 24 Jan 2013 10:13:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (3.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 16ms (Views: 10.1ms | ActiveRecord: 3.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 10ms (Views: 7.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-01-24 10:13:18.092079' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (1.0ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (4.5ms) rollback transaction  (4.3ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 11ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:28:08', '2013-05-24 10:28:08') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:28:08', '2013-05-24 10:28:08', 980190962) Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:28:08', '2013-05-24 10:28:08', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:28:08', '2013-05-24 10:28:08') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:28:08', '2013-05-24 10:28:08')  (204.8ms) commit transaction  (1.7ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (3.9ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:28:08.904732' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.4ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 195ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:28:09 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:28:09 UTC +00:00]] Disclaimer::SegmentHolder Load (1.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:28:09 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:28:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 65ms (ActiveRecord: 2.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.5ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:28:09 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:28:09 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:28:09 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:28:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 51ms (ActiveRecord: 5.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:28:09 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:28:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 62ms (Views: 58.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.7ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 78ms (Views: 75.3ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.4ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 25ms (Views: 23.7ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 10.5ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:28:09.759148' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 16ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:28:09 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:28:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:28:09.811758' WHERE "disclaimer_segments"."id" = 1  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:28:09.837301' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:28:09.863531' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:28:09 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:28:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 22ms (Views: 20.1ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:28:10.024300' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 10ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.5ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 20ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 4ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.1ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:29:43', '2013-05-24 10:29:43') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:29:43', '2013-05-24 10:29:43', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:29:43', '2013-05-24 10:29:43', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:29:43', '2013-05-24 10:29:43') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:29:43', '2013-05-24 10:29:43')  (246.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:29:44.246538' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 58ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:29:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:29:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:29:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:29:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:29:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:29:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:29:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:29:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:29:44 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:29:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 23.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 4.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 60ms (Views: 57.5ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 8.2ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 9.1ms | ActiveRecord: 2.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:29:44.777858' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:29:44 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:29:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (2.7ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:29:44.835442' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.7ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:29:44.858777' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:29:44.886036' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:29:44 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:29:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 5ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 12.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 12.0ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 29ms (Views: 14.6ms | ActiveRecord: 1.8ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 11ms (Views: 9.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:29:45.093731' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 10ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 8ms (Views: 7.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to //disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 8ms (ActiveRecord: 0.3ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:31:22', '2013-05-24 10:31:22') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:31:22', '2013-05-24 10:31:22', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:31:22', '2013-05-24 10:31:22', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:31:22', '2013-05-24 10:31:22') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:31:22', '2013-05-24 10:31:22')  (243.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (9.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:31:23.151850' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 3ms (ActiveRecord: 1.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 55ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.5ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:31:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:31:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:31:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:31:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 34ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.1ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (3.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:31:23 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:31:23 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:31:23 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:31:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 43ms (ActiveRecord: 5.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:31:23 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:31:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 21.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (3.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 52ms (Views: 46.9ms | ActiveRecord: 3.9ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.5ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (1.3ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.0ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:31:23.671616' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:31:23 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:31:23 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:31:23.718000' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:31:23.751401' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.4ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:31:23.773687' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (4.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:31:23 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:31:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 11ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (6.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 21.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 18ms (Views: 15.9ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.1ms) Completed 200 OK in 19ms (Views: 9.6ms | ActiveRecord: 0.2ms)  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:31:23.966531' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 4ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.7ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 12ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 7ms (Views: 7.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.5ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:34:55', '2013-05-24 10:34:55') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:34:55', '2013-05-24 10:34:55', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:34:55', '2013-05-24 10:34:55', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:34:55', '2013-05-24 10:34:55') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:34:55', '2013-05-24 10:34:55')  (230.2ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:34:55.522924' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (2.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 65ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:34:55 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:34:55 UTC +00:00]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:34:55 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:34:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 27ms (ActiveRecord: 2.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:34:55 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:34:55 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:34:55 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:34:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.4ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:34:55 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:34:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 23.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 49ms (Views: 44.4ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 7.5ms | ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.6ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 15ms (Views: 13.3ms | ActiveRecord: 0.9ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 6.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:34:56.029486' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 4.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:34:56 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:34:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:34:56.077902' WHERE "disclaimer_segments"."id" = 1  (3.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:34:56.108086' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:34:56.133941' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:34:56 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:34:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 3ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 17.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 26ms (Views: 17.8ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 14ms (Views: 10.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:34:56.320424' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 6ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.7ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:35:59', '2013-05-24 10:35:59') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:35:59', '2013-05-24 10:35:59', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:35:59', '2013-05-24 10:35:59', 298486374) Fixture Delete (1.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:35:59', '2013-05-24 10:35:59') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:35:59', '2013-05-24 10:35:59')  (269.3ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:35:59.386564' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 69ms (ActiveRecord: 3.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:35:59 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:35:59 UTC +00:00]] Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:35:59 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:35:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 3.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.5ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:35:59 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:35:59 UTC +00:00]] Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:35:59 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:35:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:35:59 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:35:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 29ms (Views: 26.2ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.5ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 52ms (Views: 49.7ms | ActiveRecord: 0.8ms)  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.4ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (2.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 13ms (Views: 9.4ms | ActiveRecord: 2.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 6.6ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:35:59.918708' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 3.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:35:59 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:35:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:35:59.974851' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:35:59.998629' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:36:00.032041' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (13.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:36:00 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:36:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 18ms (ActiveRecord: 13.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 18ms (Views: 10.8ms | ActiveRecord: 0.1ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (2.6ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 10ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 26ms (Views: 23.0ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 8ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (5.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (2.7ms) Completed 200 OK in 26ms (Views: 19.1ms | ActiveRecord: 5.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (5.5ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:36:00.258133' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 13ms (ActiveRecord: 5.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 13ms (Views: 12.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 11ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.7ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:40:14', '2013-05-24 10:40:14') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:40:14', '2013-05-24 10:40:14', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:40:14', '2013-05-24 10:40:14', 298486374) Fixture Delete (1.1ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.6ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:40:14', '2013-05-24 10:40:14') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:40:14', '2013-05-24 10:40:14')  (282.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:40:14.458128' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.2ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 55ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:14 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:40:14 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:14 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:40:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 3.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (7.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:14 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:40:14 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:14 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:40:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 50ms (ActiveRecord: 9.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:14 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:40:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 24.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.5ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.6ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 51ms (Views: 46.5ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 15ms (Views: 14.2ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 7.6ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:40:14.967880' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.0ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:15 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:40:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:40:15.014897' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:40:15.041086' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:40:15.066784' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (7.4ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:40:15 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:40:15 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 16.3ms | ActiveRecord: 0.1ms)  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 0.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 20ms (Views: 16.6ms | ActiveRecord: 1.8ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 14ms (Views: 12.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:40:15.260506' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 11ms (Views: 10.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 8ms  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 5ms (Views: 4.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (3.9ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:40:40', '2013-05-24 10:40:40') Fixture Delete (1.0ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:40:40', '2013-05-24 10:40:40', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:40:40', '2013-05-24 10:40:40', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.6ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:40:40', '2013-05-24 10:40:40') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:40:40', '2013-05-24 10:40:40')  (210.9ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:40:41.202838' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.4ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 57ms (ActiveRecord: 3.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:41 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:40:41 UTC +00:00]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:41 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:40:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 4.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:41 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:40:41 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:41 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:40:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 46ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:41 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:40:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.6ms)  (0.7ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 22.0ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 58ms (Views: 54.7ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 8.5ms | ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 15ms (Views: 14.2ms | ActiveRecord: 0.7ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.3ms | ActiveRecord: 0.4ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:40:41.745928' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 5.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (1.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:40:41 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:40:41 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.4ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:40:41.795448' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:40:41.818754' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:40:41.846991' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (5.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:40:41 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:40:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 19.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 4ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 10.3ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 17ms (Views: 14.9ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 14ms (Views: 11.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (2.2ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:40:42.038728' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 10ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 6ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 9ms (Views: 8.9ms | ActiveRecord: 0.0ms)  (0.3ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (6.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:42:12', '2013-05-24 10:42:12') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:42:12', '2013-05-24 10:42:12', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:42:12', '2013-05-24 10:42:12', 298486374) Fixture Delete (0.9ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:42:12', '2013-05-24 10:42:12') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:42:12', '2013-05-24 10:42:12')  (219.8ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:42:12.786293' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.2ms)  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (2.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 58ms (ActiveRecord: 4.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 5.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:42:13 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:42:13 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:42:13 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:42:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 20ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (22.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:42:13 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:42:13 UTC +00:00]] Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:42:13 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:42:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 38ms (ActiveRecord: 24.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:42:13 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:42:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 1.9ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 21.6ms | ActiveRecord: 0.2ms)  (1.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (2.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 3.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.5ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.5ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 53ms (Views: 50.3ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.7ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 13ms (Views: 11.7ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 6.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:42:13.375675' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 8.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (1.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (5.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:42:13 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:42:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:42:13.436344' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (4.9ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:42:13.467198' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (7.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (7.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:42:13.505343' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (7.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (2.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.3ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:42:13 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:42:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 7ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 7.1ms | ActiveRecord: 0.2ms)  (1.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.9ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 2.1ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 23ms (Views: 21.4ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.9ms) Completed 200 OK in 18ms (Views: 16.4ms | ActiveRecord: 0.1ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:42:13.686355' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer Filter chain halted as # rendered or redirected Completed 302 Found in 5ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:43:07', '2013-05-24 10:43:07') Fixture Delete (3.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:43:08', '2013-05-24 10:43:08', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:43:08', '2013-05-24 10:43:08', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:43:08', '2013-05-24 10:43:08') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:43:08', '2013-05-24 10:43:08')  (261.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:43:08.351119' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (2.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 57ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:43:08 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:43:08 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:43:08 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:43:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 28ms (ActiveRecord: 2.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.0ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:43:08 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:43:08 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:43:08 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:43:08 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 41ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:43:08 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:43:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 22.3ms | ActiveRecord: 0.2ms)  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (2.7ms) SAVEPOINT active_record_1 SQL (5.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 13ms (ActiveRecord: 7.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 53ms (Views: 50.6ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 19ms (Views: 18.0ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 10.2ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:43:08.875696' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:43:08 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:43:08 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:43:08.925114' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (5.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:43:08.962086' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (8.5ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:43:08.989276' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:43:09 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:43:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (1.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (2.5ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 12ms (Views: 10.3ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.1ms) Completed 200 OK in 25ms (Views: 23.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:43:09.186924' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 15ms (ActiveRecord: 0.6ms)  (3.8ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 6ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.4ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:44:30', '2013-05-24 10:44:30') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:44:30', '2013-05-24 10:44:30', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:44:30', '2013-05-24 10:44:30', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:44:30', '2013-05-24 10:44:30') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:44:30', '2013-05-24 10:44:30')  (238.3ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:44:30.590675' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 56ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:30 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:44:30 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:30 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:44:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 25ms (ActiveRecord: 2.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.0ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:30 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:44:30 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:30 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:44:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 49ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.9ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:30 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:44:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 2.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 25ms (Views: 22.9ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 7ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 47ms (Views: 43.7ms | ActiveRecord: 0.9ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.0ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 16ms (Views: 14.3ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 6.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (1.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:44:31.107961' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.4ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:31 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:44:31 UTC +00:00]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:44:31.157960' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:44:31.187702' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:44:31.210685' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:44:31 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:44:31 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 4ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 19.8ms | ActiveRecord: 0.3ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 14ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 8.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 14ms (Views: 11.9ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 9ms (Views: 8.8ms | ActiveRecord: 0.0ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.9ms) Completed 200 OK in 13ms (Views: 11.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:44:31.404690' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 3.0ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (1.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer../disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 9ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 8ms (Views: 8.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (1.9ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:44:56', '2013-05-24 10:44:56') Fixture Delete (0.7ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:44:56', '2013-05-24 10:44:56', 980190962) Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:44:56', '2013-05-24 10:44:56', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:44:56', '2013-05-24 10:44:56') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:44:56', '2013-05-24 10:44:56')  (230.4ms) commit transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:44:56.863497' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (2.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 57ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:57 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:44:57 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:57 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:44:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 28ms (ActiveRecord: 4.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.8ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:57 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:44:57 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:57 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:44:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:57 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:44:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 2.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 21.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 49ms (Views: 46.8ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 14ms (Views: 13.0ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 6.5ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.7ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:44:57.375308' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (2.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:44:57 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:44:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:44:57.422424' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.0ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:44:57.451271' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:44:57.475319' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:44:57 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:44:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 20ms (Views: 18.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 7ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 17ms (Views: 16.0ms | ActiveRecord: 0.2ms)  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 13ms (Views: 10.6ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (2.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 11ms (Views: 9.2ms | ActiveRecord: 0.1ms)  (4.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:44:57.674223' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/../disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 8ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:53:32', '2013-05-24 10:53:32') Fixture Delete (3.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:53:32', '2013-05-24 10:53:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:53:32', '2013-05-24 10:53:32', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:53:32', '2013-05-24 10:53:32') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:53:32', '2013-05-24 10:53:32')  (274.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:53:32.637902' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1  (1.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.9ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 60ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:32 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:53:32 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:32 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:53:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 23ms (ActiveRecord: 4.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (1.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:32 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:53:32 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:32 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:53:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:32 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:53:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 21.6ms | ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 4.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 82ms (Views: 77.6ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 14ms (Views: 8.6ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 10.8ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (1.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.5ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:53:33.185170' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (1.7ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:33 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:53:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:53:33.236293' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:53:33.263593' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:53:33.291268' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:53:33 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:53:33 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 11ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 15ms (Views: 14.0ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (5.7ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 10ms (ActiveRecord: 6.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.8ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 19ms (Views: 14.9ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (2.6ms) Completed 200 OK in 13ms (Views: 11.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.5ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:53:33.475901' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.8ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 10ms (Views: 9.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 9ms  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 6ms (Views: 6.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:53:56', '2013-05-24 10:53:56') Fixture Delete (1.1ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:53:57', '2013-05-24 10:53:57', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:53:57', '2013-05-24 10:53:57', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:53:57', '2013-05-24 10:53:57') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:53:57', '2013-05-24 10:53:57')  (233.4ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:53:57.275255' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 59ms (ActiveRecord: 1.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:57 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:53:57 UTC +00:00]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:57 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:53:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 30ms (ActiveRecord: 2.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:57 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:53:57 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:57 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:53:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:57 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:53:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 8ms (ActiveRecord: 4.4ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 22.6ms | ActiveRecord: 1.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 49ms (Views: 47.0ms | ActiveRecord: 0.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.6ms | ActiveRecord: 0.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 17ms (Views: 15.6ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.1ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (2.4ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:53:57.780032' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 3.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:53:57 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:53:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (2.7ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:53:57.830952' WHERE "disclaimer_segments"."id" = 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:53:57.856051' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:53:57.880233' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.5ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:53:57 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:53:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 13.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 11.4ms | ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (4.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (6.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 33ms (Views: 21.7ms | ActiveRecord: 10.7ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 17ms (Views: 16.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 24ms (Views: 22.6ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.2ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:53:58.112642' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 17ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 7ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:54:28', '2013-05-24 10:54:28') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:54:28', '2013-05-24 10:54:28', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:54:28', '2013-05-24 10:54:28', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:54:28', '2013-05-24 10:54:28') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:54:28', '2013-05-24 10:54:28')  (248.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:54:28.804363' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (1.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (1.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 61ms (ActiveRecord: 2.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:29 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:54:29 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:29 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:54:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 27ms (ActiveRecord: 3.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:29 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:54:29 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:29 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:54:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:29 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:54:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 10ms (ActiveRecord: 1.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 26ms (Views: 22.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.6ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (2.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.4ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 55ms (Views: 52.4ms | ActiveRecord: 1.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.1ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 11.2ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.5ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:54:29.331139' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (1.4ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (2.2ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:29 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:54:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:54:29.387447' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:54:29.408547' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:54:29.438651' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (6.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (7.5ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.9ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:54:29 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:54:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 6ms (ActiveRecord: 3.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 19ms (Views: 17.5ms | ActiveRecord: 0.1ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.6ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (4.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 24ms (Views: 16.7ms | ActiveRecord: 5.4ms) Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 13ms (Views: 11.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:54:29.636372' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 1.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (1.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer//documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 8ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.9ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:54:53', '2013-05-24 10:54:53') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:54:53', '2013-05-24 10:54:53', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:54:53', '2013-05-24 10:54:53', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:54:53', '2013-05-24 10:54:53') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:54:53', '2013-05-24 10:54:53')  (249.8ms) commit transaction  (0.3ms) begin transaction Disclaimer::Document Load (0.9ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.3ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:54:54.061913' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.5ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.2ms)  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 55ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:54 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:54:54 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:54 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:54:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 2.1ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:54 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:54:54 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:54 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:54:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 44ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:54 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:54:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 5ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 22.5ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.6ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 59ms (Views: 53.5ms | ActiveRecord: 1.1ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 8.1ms | ActiveRecord: 0.3ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 11.5ms | ActiveRecord: 0.4ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 9.4ms | ActiveRecord: 1.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.5ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:54:54.574621' WHERE "disclaimer_documents"."id" = 1  (1.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 2.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 1.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:54:54 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:54:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:54:54.622721' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (1.5ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:54:54.647089' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:54:54.673806' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (2.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:54:54 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:54:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 7ms (ActiveRecord: 2.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 21ms (Views: 19.7ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 15ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 18ms (Views: 15.8ms | ActiveRecord: 1.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 32ms (Views: 30.7ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 12ms (Views: 11.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.5ms) Completed 200 OK in 13ms (Views: 11.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (2.4ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:54:54.889698' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 9ms (ActiveRecord: 3.7ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.3ms) rollback transaction  (0.1ms) begin transaction  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 11ms (Views: 10.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 12ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.0ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.0ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 10:55:47', '2013-05-24 10:55:47') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 10:55:47', '2013-05-24 10:55:47', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 10:55:47', '2013-05-24 10:55:47', 298486374) Fixture Delete (1.0ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 10:55:47', '2013-05-24 10:55:47') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 10:55:47', '2013-05-24 10:55:47')  (257.5ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (4.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:55:47.882770' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (2.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 91ms (ActiveRecord: 4.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:55:48 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:55:48 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:55:48 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:55:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 23ms (ActiveRecord: 3.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (2.6ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 3.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.9ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:55:48 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:55:48 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:55:48 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 10:55:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 40ms (ActiveRecord: 2.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:55:48 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 10:55:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 2.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 33ms (Views: 31.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (1.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 48ms (Views: 45.2ms | ActiveRecord: 1.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 13ms (Views: 10.8ms | ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 17ms (Views: 15.7ms | ActiveRecord: 0.5ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 8.3ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 10:55:48.435969' WHERE "disclaimer_documents"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.8ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 4.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (3.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 10:55:48 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 10:55:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (2.5ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 10:55:48.490089' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.6ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:55:48.513515' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (1.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 10:55:48.536104' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 10:55:48 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 10:55:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 12ms (ActiveRecord: 0.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (3.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 12.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 3ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (1.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 13.5ms | ActiveRecord: 1.7ms)  (0.3ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 25ms (Views: 15.2ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.6ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 10ms (Views: 9.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.7ms) Completed 200 OK in 23ms (Views: 17.4ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (1.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 10:55:48.757549' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 5ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 11:02:08', '2013-05-24 11:02:08') Fixture Delete (0.6ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 11:02:08', '2013-05-24 11:02:08', 980190962) Fixture Insert (0.2ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 11:02:08', '2013-05-24 11:02:08', 298486374) Fixture Delete (0.8ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 11:02:08', '2013-05-24 11:02:08') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 11:02:08', '2013-05-24 11:02:08')  (286.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.7ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:02:08.820871' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.7ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 62ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:09 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:02:09 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.5ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:09 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:02:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:09 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:02:09 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:09 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:02:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 39ms (ActiveRecord: 2.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:09 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 11:02:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 23ms (Views: 20.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (3.2ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 8ms (ActiveRecord: 3.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 54ms (Views: 48.4ms | ActiveRecord: 1.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 9.2ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 12ms (Views: 11.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 8ms (Views: 6.1ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.6ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (6.1ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 11:02:09.355958' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 14ms (ActiveRecord: 8.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (8.8ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 19ms (ActiveRecord: 9.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.4ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:09 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:02:09 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1  (0.3ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:02:09.433523' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:02:09.465740' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:02:09.492127' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.4ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 11:02:09 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 11:02:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 4.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.5ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 11ms (Views: 9.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 6ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (2.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 12ms (Views: 10.2ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (1.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 12ms (Views: 10.3ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (7.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 13ms (Views: 12.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.9ms) Completed 200 OK in 23ms (Views: 21.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (3.1ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 11:02:09.674570' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 8ms (ActiveRecord: 3.4ms)  (0.3ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 6ms  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 1ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.2ms) begin transaction Fixture Delete (1.2ms) DELETE FROM "disclaimer_documents" Fixture Insert (2.3ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 11:02:32', '2013-05-24 11:02:32') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 11:02:32', '2013-05-24 11:02:32', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 11:02:32', '2013-05-24 11:02:32', 298486374) Fixture Delete (0.7ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 11:02:32', '2013-05-24 11:02:32') Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 11:02:32', '2013-05-24 11:02:32')  (192.7ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:02:32.828833' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 1ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 86ms (ActiveRecord: 4.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 11ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.4ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:33 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:02:33 UTC +00:00]] Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:33 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:02:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 24ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (1.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.7ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:33 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:02:33 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:33 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:02:33 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 42ms (ActiveRecord: 5.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:33 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 11:02:33 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 6ms (ActiveRecord: 2.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 28ms (Views: 25.8ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 17ms (ActiveRecord: 1.3ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.0ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 44ms (Views: 41.8ms | ActiveRecord: 0.6ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 9.8ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.8ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 17ms (Views: 15.0ms | ActiveRecord: 1.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 9ms (Views: 7.6ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (1.7ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (3.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 11:02:33.399600' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 12ms (ActiveRecord: 4.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.3ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:02:33 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:02:33 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1  (3.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.9ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:02:33.450063' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (1.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:02:33.472735' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.2ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:02:33.498536' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.8ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 11:02:33 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 11:02:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 8ms (ActiveRecord: 1.8ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 13ms (Views: 11.6ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 3ms (ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 16ms (Views: 15.2ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 23ms (Views: 21.3ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 13ms (Views: 10.7ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 11:02:33.683199' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 1.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (4.3ms) DELETE FROM "disclaimer_documents" Fixture Insert (1.4ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 11:06:44', '2013-05-24 11:06:44') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 11:06:44', '2013-05-24 11:06:44', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 11:06:44', '2013-05-24 11:06:44', 298486374) Fixture Delete (0.5ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.2ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 11:06:44', '2013-05-24 11:06:44') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 11:06:44', '2013-05-24 11:06:44')  (230.0ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:06:44.506368' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 4ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 55ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.3ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 0.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:06:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:06:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:06:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:06:44 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 27ms (ActiveRecord: 3.0ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 6ms (ActiveRecord: 0.7ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 7ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (2.7ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:06:44 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:06:44 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:06:44 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:06:44 UTC +00:00]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 45ms (ActiveRecord: 2.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:06:44 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 11:06:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 22ms (Views: 20.1ms | ActiveRecord: 0.3ms)  (0.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (2.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 10ms (ActiveRecord: 1.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 54ms (Views: 51.9ms | ActiveRecord: 0.8ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 9.4ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"   (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 21ms (Views: 20.2ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 12ms (Views: 8.9ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 11:06:45.028781' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.8ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.2ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.4ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:06:45 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:06:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.4ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:06:45.080066' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.5ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:06:45.108916' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:06:45.129922' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (5.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 11:06:45 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 11:06:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 10ms (ActiveRecord: 5.1ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (2.9ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 24ms (Views: 21.6ms | ActiveRecord: 0.3ms)  (0.3ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 0.5ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 18ms (Views: 17.4ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 19ms (Views: 18.0ms | ActiveRecord: 0.5ms) Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"   (0.2ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.6ms) Completed 200 OK in 13ms (Views: 11.0ms | ActiveRecord: 0.2ms)  (0.0ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (2.4ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 11:06:45.332424' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 7ms (ActiveRecord: 2.6ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.2ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 4ms (Views: 4.0ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 11ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Completed 200 OK in 10ms (Views: 9.6ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction Connecting to database specified by database.yml Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Disclaimer::Document Load (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.1ms) begin transaction Fixture Delete (1.1ms) DELETE FROM "disclaimer_documents" Fixture Insert (0.8ms) INSERT INTO "disclaimer_documents" ("id", "name", "title", "header", "footer", "created_at", "updated_at") VALUES (1, 'one', 'A Disclaimer', 'You must read my disclaimer', 'Disclaimer bottom', '2013-05-24 11:25:04', '2013-05-24 11:25:04') Fixture Delete (0.5ms) DELETE FROM "disclaimer_segment_holders" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 1, 1, '2013-05-24 11:25:04', '2013-05-24 11:25:04', 980190962) Fixture Insert (0.1ms) INSERT INTO "disclaimer_segment_holders" ("document_id", "segment_id", "position", "created_at", "updated_at", "id") VALUES (1, 2, 2, '2013-05-24 11:25:04', '2013-05-24 11:25:04', 298486374) Fixture Delete (0.6ms) DELETE FROM "disclaimer_segments" Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (1, 'one', 'MyString', 'MyText', '2013-05-24 11:25:04', '2013-05-24 11:25:04') Fixture Insert (0.1ms) INSERT INTO "disclaimer_segments" ("id", "name", "title", "body", "created_at", "updated_at") VALUES (2, 'two', 'MyString', 'MyText', '2013-05-24 11:25:04', '2013-05-24 11:25:04')  (627.8ms) commit transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.4ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1  (1.3ms) UPDATE "disclaimer_documents" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:25:05.508702' WHERE "disclaimer_documents"."id" = 1  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#accept as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents Completed 302 Found in 2ms (ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>{2=>"yes"}}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.0ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 61ms (ActiveRecord: 1.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (2.3ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (1.1ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 10ms (ActiveRecord: 3.8ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (1.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.3ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (2.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:25:05 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:25:05 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.2ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:25:05 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:25:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 26ms (ActiveRecord: 3.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.2ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 0.9ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (4.7ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 13ms (ActiveRecord: 5.4ms) Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" LIMIT 1 Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1 Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::SegmentHolder Load (0.6ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.0ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:25:05 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:25:05 UTC +00:00]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (0.1ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:25:05 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 24 May 2013 11:25:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 61ms (ActiveRecord: 2.6ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (1.0ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#create as HTML Parameters: {"document"=>{"title"=>"Create document", "name"=>"new document"}}  (0.1ms) SAVEPOINT active_record_1 SQL (4.3ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:25:05 UTC +00:00], ["footer", nil], ["header", nil], ["name", "new_document"], ["title", "Create document"], ["updated_at", Fri, 24 May 2013 11:25:05 UTC +00:00]]  (2.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/new_document Completed 302 Found in 11ms (ActiveRecord: 6.6ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" ORDER BY "disclaimer_documents"."id" DESC LIMIT 1  (0.4ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 30ms (Views: 26.9ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.2ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Processing by Disclaimer::DocumentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? [["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/ Completed 302 Found in 5ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"   (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.6ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 81ms (Views: 76.5ms | ActiveRecord: 3.5ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#index as HTML Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 10ms (Views: 7.3ms | ActiveRecord: 0.4ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"  (0.0ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#new as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 1 LIMIT 1 Disclaimer::Segment Exists (0.1ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" IS NULL AND "disclaimer_segments"."id" = 2 LIMIT 1 Completed 200 OK in 16ms (Views: 14.8ms | ActiveRecord: 0.4ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::DocumentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Segment Load (2.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Completed 200 OK in 11ms (Views: 6.7ms | ActiveRecord: 2.7ms)  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents"  Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"title"=>"Document update"}} Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.6ms) UPDATE "disclaimer_documents" SET "title" = 'Document update', "updated_at" = '2013-05-24 11:25:06.108465' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 8ms (ActiveRecord: 2.2ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_documents" Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]]  (1.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Processing by Disclaimer::DocumentsController#update as HTML Parameters: {"id"=>"one", "document"=>{"segments"=>nil}} Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position SQL (0.9ms) DELETE FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IN (1, 2)  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/documents/one Completed 302 Found in 9ms (ActiveRecord: 1.5ms) Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.0ms) SAVEPOINT active_record_1 Disclaimer::SegmentHolder Load (0.5ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1 SQL (1.6ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 24 May 2013 11:25:06 UTC +00:00], ["document_id", 1], ["position", 3], ["segment_id", 1], ["updated_at", Fri, 24 May 2013 11:25:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) SAVEPOINT active_record_1  (1.6ms) UPDATE "disclaimer_segments" SET "name" = 'this_is_a_name', "updated_at" = '2013-05-24 11:25:06.163592' WHERE "disclaimer_segments"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position LIMIT 1 Disclaimer::SegmentHolder Load (0.1ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.3ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:25:06.193496' WHERE "disclaimer_segment_holders"."id" = 980190962  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.7ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.2ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segment_holders"."segment_id" IS NULL ORDER BY position LIMIT 1  (2.6ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]] Disclaimer::SegmentHolder Load (0.3ms) SELECT DISTINCT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "disclaimer_segment_holders" SET position = (position - 1) WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position > 1) Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND id != 980190962) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1  (0.4ms) UPDATE "disclaimer_segment_holders" SET "position" = 2, "updated_at" = '2013-05-24 11:25:06.227337' WHERE "disclaimer_segment_holders"."id" = 980190962  (1.3ms) SELECT COUNT(*) FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1 AND position = 2)  (0.1ms) RELEASE SAVEPOINT active_record_1 Disclaimer::Segment Load (0.5ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position  (0.9ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.2ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 2]]  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (1.4ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#create as HTML Parameters: {"segment"=>{"title"=>"Create segment", "name"=>"new segment"}}  (0.1ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 24 May 2013 11:25:06 UTC +00:00], ["name", "new_segment"], ["title", "Create segment"], ["updated_at", Fri, 24 May 2013 11:25:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/new_segment Completed 302 Found in 7ms (ActiveRecord: 1.9ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Disclaimer::Segment Load (0.9ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" ORDER BY "disclaimer_segments"."id" DESC LIMIT 1  (1.5ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#delete as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 14ms (Views: 12.1ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Processing by Disclaimer::SegmentsController#destroy as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.0ms) SAVEPOINT active_record_1 SQL (0.9ms) DELETE FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? [["id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments Completed 302 Found in 9ms (ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "disclaimer_segments"   (0.4ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#edit as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Completed 200 OK in 8ms (Views: 6.8ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#index as HTML Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 2 ORDER BY position Completed 200 OK in 19ms (Views: 16.8ms | ActiveRecord: 0.6ms) Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#new as HTML Completed 200 OK in 5ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]] Processing by Disclaimer::SegmentsController#show as HTML Parameters: {"id"=>"one"} Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1 Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.8ms) Completed 200 OK in 12ms (Views: 10.1ms | ActiveRecord: 0.2ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments"  Processing by Disclaimer::SegmentsController#update as HTML Parameters: {"id"=>"one", "segment"=>{"title"=>"Segment update"}} Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1  (0.1ms) SAVEPOINT active_record_1  (1.0ms) UPDATE "disclaimer_segments" SET "title" = 'Segment update', "updated_at" = '2013-05-24 11:25:06.396829' WHERE "disclaimer_segments"."id" = 1  (0.0ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/disclaimer/segments/one Completed 302 Found in 10ms (ActiveRecord: 1.4ms)  (0.1ms) SELECT COUNT(*) FROM "disclaimer_segments" Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", 1]]  (0.6ms) rollback transaction  (0.1ms) begin transaction  (0.1ms) rollback transaction  (0.1ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#bypass_disclaimer as HTML Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (1.1ms) UPDATE "disclaimer_documents" SET "name" = 'something_else', "updated_at" = '2013-05-24 11:25:06.430794' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by SampleController#index as HTML Disclaimer::Document Exists (0.1ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 No disclaimer displayed as unable to find Disclaimer::Document with name 'one' Completed 200 OK in 5ms (Views: 2.5ms | ActiveRecord: 0.1ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1  (0.0ms) SAVEPOINT active_record_1  (0.9ms) UPDATE "disclaimer_documents" SET "name" = 'something_else', "updated_at" = '2013-05-24 11:25:06.445394' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by SampleController#index as HTML Disclaimer::Document Exists (0.1ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 No disclaimer displayed as unable to find Disclaimer::Document with name 'one' Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.1ms)  (0.0ms) SAVEPOINT active_record_1  (0.4ms) UPDATE "disclaimer_documents" SET "name" = 'one', "updated_at" = '2013-05-24 11:25:06.453341' WHERE "disclaimer_documents"."id" = 1  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by SampleController#index as HTML Disclaimer::Document Exists (0.3ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 11ms (Views: 1.0ms | ActiveRecord: 0.5ms)  (0.5ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Exists (0.1ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Disclaimer::Document Load (0.1ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Redirected to http://test.host/disclaimer/documents/one Filter chain halted as # rendered or redirected Completed 302 Found in 4ms (ActiveRecord: 0.3ms)  (0.1ms) rollback transaction  (0.0ms) begin transaction Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1 Processing by SampleController#index as HTML Disclaimer::Document Exists (0.1ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'one' LIMIT 1 Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.1ms)  (0.1ms) rollback transaction