(0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (32.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:06:10.722909"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:06:10.722909"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (6.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.763009"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:06:10.744787"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.763009"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.775113"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:06:10.772463"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.775113"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.779630"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:06:10.777598"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.779630"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.8ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:06:10.792771"], ["pending_at", "2014-10-21 05:06:10.792401"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.792771"]]  (9.0ms) COMMIT  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:06:10.804141"], ["pending_at", "2014-10-21 05:06:10.803510"], ["state", "imported"], ["updated_at", "2014-10-21 05:06:10.804141"]]  (6.5ms) COMMIT S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:06:10.864568"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:06:10.864568"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.867571"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:06:10.866032"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.867571"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.870306"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:06:10.868984"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.870306"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.872987"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:06:10.871659"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.872987"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:06:10.883897"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:06:10.883897"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.886681"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:06:10.885257"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.886681"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.889442"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:06:10.888240"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.889442"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.892022"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:06:10.890770"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.892022"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = 'c0039e1f-4510-44a8-9445-7ba965a0c386' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:06:10.903838"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:06:10.903838"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.907076"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:06:10.905530"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.907076"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.909607"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:06:10.908424"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.909607"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0039e1f-4510-44a8-9445-7ba965a0c386 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:06:10.912037"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:06:10.910855"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.912037"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('c0039e1f-4510-44a8-9445-7ba965a0c386', 'c0039e1f-4510-44a8-9445-7ba965a0c386') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:06:10.917154"], ["pending_at", "2014-10-21 05:06:10.916800"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.917154"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:06:10.918971"], ["pending_at", "2014-10-21 05:06:10.918684"], ["state", "imported"], ["updated_at", "2014-10-21 05:06:10.918971"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:06:10.934568"], ["pending_at", "2014-10-21 05:06:10.934257"], ["state", "pending"], ["updated_at", "2014-10-21 05:06:10.934568"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (27.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:39:58.677764"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:39:58.677764"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (6.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.700151"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:39:58.688245"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.700151"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.744689"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:39:58.741641"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.744689"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.748974"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:39:58.746977"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.748974"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:39:58.759562"], ["pending_at", "2014-10-21 05:39:58.759207"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.759562"]]  (8.8ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:39:58.770375"], ["pending_at", "2014-10-21 05:39:58.770015"], ["state", "imported"], ["updated_at", "2014-10-21 05:39:58.770375"]]  (6.4ms) COMMIT S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:39:58.789361"], ["pending_at", "2014-10-21 05:39:58.788826"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.789361"]]  (6.3ms) COMMIT  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:39:58.797625"], ["pending_at", "2014-10-21 05:39:58.797183"], ["state", "imported"], ["updated_at", "2014-10-21 05:39:58.797625"]]  (6.0ms) COMMIT S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 05:39:58.816073"], ["pending_at", "2014-10-21 05:39:58.815720"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.816073"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:39:58.831854"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:39:58.831854"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.834894"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:39:58.833363"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.834894"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.837882"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:39:58.836449"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.837882"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.840485"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:39:58.839271"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.840485"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = '04ed6b3a-e622-4bab-82cb-b0281f0bdc58' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:39:58.846717"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:39:58.846717"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.849755"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:39:58.848137"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.849755"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.852561"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:39:58.851162"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.852561"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.855391"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 05:39:58.853981"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.855391"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 05:39:58.864441"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 05:39:58.864441"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.867229"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:39:58.865803"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.867229"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.869751"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:39:58.868533"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.869751"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 04ed6b3a-e622-4bab-82cb-b0281f0bdc58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 05:39:58.872264"], ["filename", "cat.png"], ["pending_at", "2014-10-21 05:39:58.871050"], ["state", "pending"], ["updated_at", "2014-10-21 05:39:58.872264"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('04ed6b3a-e622-4bab-82cb-b0281f0bdc58', '04ed6b3a-e622-4bab-82cb-b0281f0bdc58') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:01:58.520968"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:01:58.520968"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.531386"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:01:58.523967"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.531386"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.536545"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:01:58.534442"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.536545"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.573043"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:01:58.571369"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.573043"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (1.0ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:01:58.592857"], ["pending_at", "2014-10-21 06:01:58.592187"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.592857"]]  (0.6ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:01:58.619841"], ["pending_at", "2014-10-21 06:01:58.619506"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.619841"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:01:58.621893"], ["pending_at", "2014-10-21 06:01:58.621430"], ["state", "imported"], ["updated_at", "2014-10-21 06:01:58.621893"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:01:58.641193"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:01:58.641193"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.644180"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:01:58.642648"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.644180"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.648105"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:01:58.646254"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.648105"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.651036"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:01:58.649694"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.651036"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('bd6a1c97-4ace-45b3-86ef-c23550e3c826', 'bd6a1c97-4ace-45b3-86ef-c23550e3c826') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:01:58.656696"], ["pending_at", "2014-10-21 06:01:58.656292"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.656696"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:01:58.658515"], ["pending_at", "2014-10-21 06:01:58.658226"], ["state", "imported"], ["updated_at", "2014-10-21 06:01:58.658515"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:01:58.662874"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:01:58.662874"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.665615"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:01:58.664199"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.665615"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.668269"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:01:58.667048"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.668269"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.670720"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:01:58.669547"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.670720"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.2ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = 'bd6a1c97-4ace-45b3-86ef-c23550e3c826' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:01:58.676332"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:01:58.676332"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.679319"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:01:58.677751"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.679319"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.682098"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:01:58.680705"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.682098"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bd6a1c97-4ace-45b3-86ef-c23550e3c826 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:01:58.684818"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:01:58.683463"], ["state", "pending"], ["updated_at", "2014-10-21 06:01:58.684818"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:48.500158"], ["pending_at", "2014-10-21 06:04:48.499715"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.500158"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:48.504971"], ["pending_at", "2014-10-21 06:04:48.504655"], ["state", "imported"], ["updated_at", "2014-10-21 06:04:48.504971"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:48.529832"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:48.529832"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.540633"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:48.532761"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.540633"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.546042"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:48.543615"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.546042"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.549861"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:48.548104"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.549861"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = 'a781f429-76f9-4108-9f05-633cc81d04c4' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:48.607444"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:48.607444"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.615143"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:48.609649"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.615143"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.618291"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:48.616882"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.618291"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.621011"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:48.619658"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.621011"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:48.632562"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:48.632562"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.635649"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:48.634047"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.635649"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.638437"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:48.637099"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.638437"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.641114"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:48.639789"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.641114"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:48.645757"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:48.645757"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.648542"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:48.647139"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.648542"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.651053"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:48.649856"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.651053"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a781f429-76f9-4108-9f05-633cc81d04c4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:48.653510"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:48.652322"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.653510"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('a781f429-76f9-4108-9f05-633cc81d04c4', 'a781f429-76f9-4108-9f05-633cc81d04c4') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:48.665425"], ["pending_at", "2014-10-21 06:04:48.664791"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.665425"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:48.680266"], ["pending_at", "2014-10-21 06:04:48.679949"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:48.680266"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:48.682145"], ["pending_at", "2014-10-21 06:04:48.681856"], ["state", "imported"], ["updated_at", "2014-10-21 06:04:48.682145"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:56.538369"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:56.538369"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.553841"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:56.543909"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.553841"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.557677"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:56.556122"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.557677"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.560210"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:56.558988"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.560210"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.6ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = '85e7b0f3-6922-4b7e-a696-0e6df43c0330' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:56.616103"], ["pending_at", "2014-10-21 06:04:56.615770"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.616103"]]  (1.6ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:56.623790"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:56.623790"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.630646"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:56.625272"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.630646"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.635724"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:56.633267"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.635724"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.639883"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:56.637934"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.639883"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:56.657760"], ["pending_at", "2014-10-21 06:04:56.657433"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.657760"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:56.659580"], ["pending_at", "2014-10-21 06:04:56.659291"], ["state", "imported"], ["updated_at", "2014-10-21 06:04:56.659580"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:56.675443"], ["pending_at", "2014-10-21 06:04:56.675095"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.675443"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 06:04:56.677342"], ["pending_at", "2014-10-21 06:04:56.677055"], ["state", "imported"], ["updated_at", "2014-10-21 06:04:56.677342"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:56.681438"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:56.681438"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.684115"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:56.682722"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.684115"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.686643"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:56.685425"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.686643"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.689102"], ["filename", "cat.png"], ["pending_at", "2014-10-21 06:04:56.687900"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.689102"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('85e7b0f3-6922-4b7e-a696-0e6df43c0330', '85e7b0f3-6922-4b7e-a696-0e6df43c0330') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 06:04:56.695829"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 06:04:56.695829"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.699196"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:56.697520"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.699196"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.701962"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:56.700612"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.701962"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 85e7b0f3-6922-4b7e-a696-0e6df43c0330 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 06:04:56.704634"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 06:04:56.703308"], ["state", "pending"], ["updated_at", "2014-10-21 06:04:56.704634"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (18.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (5.1ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (11.8ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (31.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (5.5ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (5.6ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.8ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.4ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (1.0ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (28.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN SQL (51.0ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:31:22.316734"], ["pending_at", "2014-10-21 07:31:22.316204"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.316734"]]  (0.8ms) COMMIT  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:31:22.375736"], ["pending_at", "2014-10-21 07:31:22.375128"], ["state", "imported"], ["updated_at", "2014-10-21 07:31:22.375736"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (11.8ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:31:22.430795"], ["pending_at", "2014-10-21 07:31:22.430455"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.430795"]]  (5.1ms) COMMIT S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:31:22.497972"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:31:22.497972"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.510524"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:31:22.501019"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.510524"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.515854"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:31:22.513555"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.515854"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.519772"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:31:22.517828"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.519772"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:31:22.527680"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:31:22.527680"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.530766"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:31:22.529215"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.530766"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.533754"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:31:22.532423"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.533754"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.536319"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:31:22.535074"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.536319"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (1.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (2.0ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = 'c7cfc51e-6873-4ed6-be73-b068d0e89177' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (1.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:31:22.547669"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:31:22.547669"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.550393"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:31:22.549015"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.550393"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.552987"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:31:22.551752"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.552987"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.555480"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:31:22.554301"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.555480"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('c7cfc51e-6873-4ed6-be73-b068d0e89177', 'c7cfc51e-6873-4ed6-be73-b068d0e89177') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:31:22.561349"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:31:22.561349"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.564583"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:31:22.562953"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.564583"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.567344"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:31:22.565984"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.567344"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7cfc51e-6873-4ed6-be73-b068d0e89177 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:31:22.570001"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:31:22.568689"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.570001"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:31:22.574636"], ["pending_at", "2014-10-21 07:31:22.574274"], ["state", "pending"], ["updated_at", "2014-10-21 07:31:22.574636"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:31:22.576481"], ["pending_at", "2014-10-21 07:31:22.576219"], ["state", "imported"], ["updated_at", "2014-10-21 07:31:22.576481"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (28.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (27.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) BEGIN SQL (6.7ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:34:47.889471"], ["pending_at", "2014-10-21 07:34:47.888902"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.889471"]]  (5.2ms) COMMIT S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:34:47.911898"], ["pending_at", "2014-10-21 07:34:47.911380"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.911898"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:34:47.914100"], ["pending_at", "2014-10-21 07:34:47.913616"], ["state", "imported"], ["updated_at", "2014-10-21 07:34:47.914100"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:34:47.927817"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:34:47.927817"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:47.951650"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:34:47.937916"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.951650"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:47.956099"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:34:47.954226"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.956099"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:47.959742"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:34:47.957950"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.959742"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:34:47.965246"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:34:47.965246"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:47.968569"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:34:47.966895"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.968569"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:47.971724"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:34:47.970290"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.971724"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:47.974592"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:34:47.973236"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.974592"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('e0f8ca3d-fe1d-4415-b92c-37dc8a724337', 'e0f8ca3d-fe1d-4415-b92c-37dc8a724337') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:34:47.993591"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:34:47.993591"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:47.996851"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:34:47.995155"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:47.996851"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:48.000567"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:34:47.998556"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:48.000567"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:48.003876"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:34:48.002269"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:48.003876"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:34:48.019915"], ["pending_at", "2014-10-21 07:34:48.019547"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:48.019915"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:34:48.021993"], ["pending_at", "2014-10-21 07:34:48.021681"], ["state", "imported"], ["updated_at", "2014-10-21 07:34:48.021993"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:34:48.026989"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:34:48.026989"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:48.030075"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:34:48.028477"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:48.030075"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:48.032840"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:34:48.031523"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:48.032840"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f8ca3d-fe1d-4415-b92c-37dc8a724337 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:34:48.035569"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:34:48.034243"], ["state", "pending"], ["updated_at", "2014-10-21 07:34:48.035569"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" = 'e0f8ca3d-fe1d-4415-b92c-37dc8a724337' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (1.0ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (28.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:38:52.311896"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:38:52.311896"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (6.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.336776"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:38:52.323765"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.336776"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.348519"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:38:52.346069"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.348519"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.352817"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:38:52.350926"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.352817"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.8ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = 'b3394f53-5acb-473c-8825-a3406902fb69' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:38:52.367302"], ["pending_at", "2014-10-21 07:38:52.366924"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.367302"]]  (8.7ms) COMMIT  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:38:52.378378"], ["pending_at", "2014-10-21 07:38:52.377744"], ["state", "imported"], ["updated_at", "2014-10-21 07:38:52.378378"]]  (6.5ms) COMMIT S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:38:52.443228"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:38:52.443228"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.454177"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:38:52.445047"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.454177"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.457381"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:38:52.455957"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.457381"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.460120"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:38:52.458775"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.460120"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:38:52.476105"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:38:52.476105"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.479120"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:38:52.477621"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.479120"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.481650"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:38:52.480450"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.481650"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.484242"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:38:52.482999"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.484242"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('b3394f53-5acb-473c-8825-a3406902fb69', 'b3394f53-5acb-473c-8825-a3406902fb69') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:38:52.505163"], ["pending_at", "2014-10-21 07:38:52.504724"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.505163"]]  (6.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:38:52.513539"], ["pending_at", "2014-10-21 07:38:52.513153"], ["state", "imported"], ["updated_at", "2014-10-21 07:38:52.513539"]]  (6.5ms) COMMIT S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:38:52.555327"], ["pending_at", "2014-10-21 07:38:52.554979"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.555327"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:38:52.561802"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:38:52.561802"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.565051"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:38:52.563317"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.565051"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.567922"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:38:52.566485"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.567922"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3394f53-5acb-473c-8825-a3406902fb69 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:38:52.570845"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:38:52.569379"], ["state", "pending"], ["updated_at", "2014-10-21 07:38:52.570845"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (28.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (27.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (27.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (29.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (6.0ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:39:46.759127"], ["pending_at", "2014-10-21 07:39:46.758703"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.759127"]]  (6.2ms) COMMIT S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:39:46.789726"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:39:46.789726"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.811532"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:39:46.799793"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.811532"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.816281"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:39:46.813912"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.816281"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.819859"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:39:46.817951"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.819859"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:39:46.842348"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:39:46.842348"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.846938"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:39:46.844292"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.846938"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.850816"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:39:46.849119"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.850816"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.854200"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:39:46.852519"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.854200"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:39:46.869712"], ["pending_at", "2014-10-21 07:39:46.869331"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.869712"]]  (6.5ms) COMMIT  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:39:46.878481"], ["pending_at", "2014-10-21 07:39:46.877799"], ["state", "imported"], ["updated_at", "2014-10-21 07:39:46.878481"]]  (5.2ms) COMMIT S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:39:46.890617"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:39:46.890617"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.894953"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:39:46.892825"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.894953"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.898467"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:39:46.896856"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.898467"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.901802"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:39:46.900204"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.901802"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('4d6d854b-c6f8-4100-8df6-4b7290c82d10', '4d6d854b-c6f8-4100-8df6-4b7290c82d10') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:39:46.923636"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:39:46.923636"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.926686"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:39:46.925135"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.926686"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.929543"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:39:46.928167"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.929543"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6d854b-c6f8-4100-8df6-4b7290c82d10 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:39:46.932971"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:39:46.930996"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.932971"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" = '4d6d854b-c6f8-4100-8df6-4b7290c82d10' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:39:46.939070"], ["pending_at", "2014-10-21 07:39:46.938677"], ["state", "pending"], ["updated_at", "2014-10-21 07:39:46.939070"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:39:46.941139"], ["pending_at", "2014-10-21 07:39:46.940764"], ["state", "imported"], ["updated_at", "2014-10-21 07:39:46.941139"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:47:16.186032"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:47:16.186032"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.206159"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:47:16.192020"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.206159"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.210256"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:47:16.208557"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.210256"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.213040"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:47:16.211717"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.213040"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:47:16.219957"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:47:16.219957"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.223167"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:47:16.221480"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.223167"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.225914"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:47:16.224570"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.225914"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.228533"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:47:16.227246"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.228533"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:47:16.297450"], ["pending_at", "2014-10-21 07:47:16.297119"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.297450"]]  (6.5ms) COMMIT  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:47:16.306286"], ["pending_at", "2014-10-21 07:47:16.305617"], ["state", "imported"], ["updated_at", "2014-10-21 07:47:16.306286"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:47:16.313535"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:47:16.313535"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.318035"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:47:16.315610"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.318035"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.321952"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:47:16.320390"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.321952"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.324748"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:47:16.323436"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.324748"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('c13428a7-8657-45f2-b1fe-169542edc731', 'c13428a7-8657-45f2-b1fe-169542edc731') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:47:16.335718"], ["pending_at", "2014-10-21 07:47:16.335397"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.335718"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:47:16.337547"], ["pending_at", "2014-10-21 07:47:16.337282"], ["state", "imported"], ["updated_at", "2014-10-21 07:47:16.337547"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:47:16.353030"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:47:16.353030"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.356322"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:47:16.354499"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.356322"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.359296"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:47:16.357889"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.359296"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c13428a7-8657-45f2-b1fe-169542edc731 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:47:16.362004"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:47:16.360711"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.362004"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.2ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" = 'c13428a7-8657-45f2-b1fe-169542edc731' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:47:16.375638"], ["pending_at", "2014-10-21 07:47:16.375051"], ["state", "pending"], ["updated_at", "2014-10-21 07:47:16.375638"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:48:39.022196"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:48:39.022196"]]  (0.4ms) COMMIT  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:49:16.012658"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:49:16.012658"]]  (0.4ms) COMMIT  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:49:34.715718"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:49:34.715718"]]  (0.4ms) COMMIT  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.9ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:49:50.303793"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:49:50.303793"]]  (0.6ms) COMMIT  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:50:05.946927"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:50:05.946927"]]  (0.4ms) COMMIT  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:50:13.274299"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:50:13.274299"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.303101"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:50:13.293548"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.303101"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.307276"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:50:13.305852"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.307276"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.311351"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:50:13.309227"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.311351"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.5ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6', 'f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:50:13.387119"], ["pending_at", "2014-10-21 07:50:13.386742"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.387119"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:50:13.393667"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:50:13.393667"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.401266"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:50:13.395223"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.401266"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.405655"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:50:13.403318"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.405655"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.409806"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:50:13.407868"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.409806"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:50:13.419228"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:50:13.419228"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.422654"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:50:13.420869"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.422654"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.425439"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:50:13.424112"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.425439"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.428149"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:50:13.426820"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.428149"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:50:13.438813"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:50:13.438813"]]  (0.6ms) COMMIT ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.3ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:50:13.468554"], ["pending_at", "2014-10-21 07:50:13.467880"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.468554"]]  (6.5ms) COMMIT  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:50:13.478172"], ["pending_at", "2014-10-21 07:50:13.477498"], ["state", "imported"], ["updated_at", "2014-10-21 07:50:13.478172"]]  (0.6ms) COMMIT S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:50:13.497395"], ["pending_at", "2014-10-21 07:50:13.497034"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.497395"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:50:13.499471"], ["pending_at", "2014-10-21 07:50:13.499126"], ["state", "imported"], ["updated_at", "2014-10-21 07:50:13.499471"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:50:13.505943"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:50:13.505943"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.508929"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:50:13.507345"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.508929"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.511615"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:50:13.510334"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.511615"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:50:13.514648"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:50:13.512985"], ["state", "pending"], ["updated_at", "2014-10-21 07:50:13.514648"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" = 'f11f2a10-35c5-46fd-bdc4-cc0dac2fcdd6' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:50:37.183655"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:50:37.183655"]]  (0.4ms) COMMIT  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (27.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) BEGIN SQL (6.0ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:56:43.214896"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:56:43.214896"]]  (11.6ms) COMMIT  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:56:55.480675"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:56:55.480675"]]  (0.4ms) COMMIT  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.3ms) BEGIN SQL (5.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:57:27.588001"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:57:27.588001"]]  (0.6ms) COMMIT  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:57:27.633251"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:57:27.633251"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (6.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.644372"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:57:27.635628"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.644372"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.656154"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:57:27.653515"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.656154"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.660791"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:57:27.658734"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.660791"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:57:27.677022"], ["pending_at", "2014-10-21 07:57:27.676703"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.677022"]]  (6.2ms) COMMIT S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:57:27.694373"], ["pending_at", "2014-10-21 07:57:27.693890"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.694373"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:57:27.696649"], ["pending_at", "2014-10-21 07:57:27.696329"], ["state", "imported"], ["updated_at", "2014-10-21 07:57:27.696649"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:57:27.709633"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:57:27.709633"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.712837"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:57:27.711175"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.712837"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.715607"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:57:27.714243"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.715607"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.719498"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 07:57:27.717264"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.719498"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:57:27.724834"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:57:27.724834"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.727674"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:57:27.726197"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.727674"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.730537"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:57:27.729257"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.730537"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.733317"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:57:27.731848"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.733317"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" = '51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:57:27.745888"], ["pending_at", "2014-10-21 07:57:27.745562"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.745888"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 07:57:27.747645"], ["pending_at", "2014-10-21 07:57:27.747378"], ["state", "imported"], ["updated_at", "2014-10-21 07:57:27.747645"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 07:57:27.752450"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 07:57:27.752450"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.755814"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:57:27.754271"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.755814"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.758333"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:57:27.757098"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.758333"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 07:57:27.760934"], ["filename", "cat.png"], ["pending_at", "2014-10-21 07:57:27.759631"], ["state", "pending"], ["updated_at", "2014-10-21 07:57:27.760934"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb', '51c27e33-6e4f-4fd0-a5b8-5778be4a2fcb') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:01:28.969224"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:01:28.969224"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:28.975854"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:01:28.972972"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:28.975854"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:28.979789"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:01:28.978302"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:28.979789"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:28.982775"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:01:28.981250"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:28.982775"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('b242efff-0f32-43b1-b82a-940e9834afd0', 'b242efff-0f32-43b1-b82a-940e9834afd0') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:01:29.026557"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:01:29.026557"]]  (0.5ms) COMMIT ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:01:29.042320"], ["pending_at", "2014-10-21 08:01:29.041969"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.042320"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:01:29.056670"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:01:29.056670"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.059837"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:01:29.058310"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.059837"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.062506"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:01:29.061290"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.062506"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.064952"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:01:29.063767"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.064952"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = 'b242efff-0f32-43b1-b82a-940e9834afd0' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:01:29.076142"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:01:29.076142"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.083151"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:01:29.077636"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.083151"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.086440"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:01:29.084914"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.086440"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.089193"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:01:29.087851"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.089193"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:01:29.099503"], ["pending_at", "2014-10-21 08:01:29.099180"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.099503"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:01:29.101496"], ["pending_at", "2014-10-21 08:01:29.101159"], ["state", "imported"], ["updated_at", "2014-10-21 08:01:29.101496"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:01:29.107470"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:01:29.107470"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.111427"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:01:29.109285"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.111427"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.114582"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:01:29.113128"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.114582"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b242efff-0f32-43b1-b82a-940e9834afd0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:01:29.117620"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:01:29.116140"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.117620"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:01:29.133539"], ["pending_at", "2014-10-21 08:01:29.133026"], ["state", "pending"], ["updated_at", "2014-10-21 08:01:29.133539"]]  (0.6ms) COMMIT  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:01:29.136181"], ["pending_at", "2014-10-21 08:01:29.135779"], ["state", "imported"], ["updated_at", "2014-10-21 08:01:29.136181"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (10.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) BEGIN SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:03:51.098451"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:03:51.098451"]]  (0.4ms) COMMIT ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:03:51.120294"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:03:51.120294"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.132772"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:03:51.123392"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.132772"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.136533"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:03:51.134987"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.136533"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.139105"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:03:51.137844"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.139105"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = '94246b5e-841c-4dd9-abf4-0ba40eba570f' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:03:51.159706"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:03:51.159706"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.168698"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:03:51.161700"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.168698"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.172198"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:03:51.170583"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.172198"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.206911"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:03:51.175751"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.206911"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.3ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:03:51.222935"], ["pending_at", "2014-10-21 08:03:51.222583"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.222935"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:03:51.225147"], ["pending_at", "2014-10-21 08:03:51.224881"], ["state", "imported"], ["updated_at", "2014-10-21 08:03:51.225147"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:03:51.245067"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:03:51.245067"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.248529"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:03:51.246777"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.248529"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.251667"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:03:51.250131"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.251667"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.255176"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:03:51.253483"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.255176"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.3ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:03:51.267849"], ["pending_at", "2014-10-21 08:03:51.267259"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.267849"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:03:51.270107"], ["pending_at", "2014-10-21 08:03:51.269761"], ["state", "imported"], ["updated_at", "2014-10-21 08:03:51.270107"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:03:51.279403"], ["pending_at", "2014-10-21 08:03:51.278972"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.279403"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:03:51.286945"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:03:51.286945"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.289943"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:03:51.288408"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.289943"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.292631"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:03:51.291346"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.292631"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 94246b5e-841c-4dd9-abf4-0ba40eba570f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:03:51.295209"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:03:51.293955"], ["state", "pending"], ["updated_at", "2014-10-21 08:03:51.295209"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('94246b5e-841c-4dd9-abf4-0ba40eba570f', '94246b5e-841c-4dd9-abf4-0ba40eba570f') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ------------------------------------------------------------------------------ S3Relay::UploadsController::{:type=>:controller}::GET new: test_0001_anonymous ------------------------------------------------------------------------------  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (3.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (28.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (6.5ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:10.213475"], ["pending_at", "2014-10-21 08:25:10.213030"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.213475"]]  (4.9ms) COMMIT  (0.2ms) BEGIN SQL (1.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:10.228334"], ["pending_at", "2014-10-21 08:25:10.227592"], ["state", "imported"], ["updated_at", "2014-10-21 08:25:10.228334"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:10.244847"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:10.244847"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.258337"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:10.254891"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.258337"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.263464"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:10.261329"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.263464"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.266706"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:10.265129"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.266706"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('6cc0680a-c985-475f-8288-cc8f83704e41', '6cc0680a-c985-475f-8288-cc8f83704e41') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:10.283819"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:10.283819"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.294306"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:10.285568"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.294306"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.297881"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:10.296242"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.297881"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.301007"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:10.299434"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.301007"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:10.310886"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:10.310886"]]  (5.3ms) COMMIT  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:10.322038"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:10.322038"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.326667"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:10.324293"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.326667"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.331024"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:10.329190"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.331024"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.334272"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:10.332691"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.334272"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" = '6cc0680a-c985-475f-8288-cc8f83704e41' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.3ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:10.343054"], ["pending_at", "2014-10-21 08:25:10.342305"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.343054"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:10.345167"], ["pending_at", "2014-10-21 08:25:10.344864"], ["state", "imported"], ["updated_at", "2014-10-21 08:25:10.345167"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:10.354037"], ["pending_at", "2014-10-21 08:25:10.353387"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.354037"]]  (0.5ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:10.385267"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:10.385267"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.388835"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:10.386993"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.388835"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.392955"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:10.390480"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.392955"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6cc0680a-c985-475f-8288-cc8f83704e41 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:10.396741"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:10.394907"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:10.396741"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.8ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) BEGIN SQL (0.7ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:19.070794"], ["pending_at", "2014-10-21 08:25:19.070083"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.070794"]]  (0.5ms) COMMIT  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:19.074995"], ["pending_at", "2014-10-21 08:25:19.074525"], ["state", "imported"], ["updated_at", "2014-10-21 08:25:19.074995"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:19.090126"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:19.090126"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.099409"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:19.092800"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.099409"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.104486"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:19.102445"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.104486"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.107519"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:19.106051"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.107519"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:19.124878"], ["pending_at", "2014-10-21 08:25:19.124546"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.124878"]]  (0.4ms) COMMIT  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:19.127047"], ["pending_at", "2014-10-21 08:25:19.126411"], ["state", "imported"], ["updated_at", "2014-10-21 08:25:19.127047"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:19.131697"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:19.131697"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.135291"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:19.133234"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.135291"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.138840"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:19.136996"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.138840"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.141467"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:19.140197"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.141467"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = 'c0856809-20a4-4a78-97df-f65079cc8f56' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:25:19.154135"], ["pending_at", "2014-10-21 08:25:19.153795"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.154135"]]  (0.4ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:19.160534"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:19.160534"]]  (0.4ms) COMMIT  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:19.166475"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:19.166475"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.169441"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:19.167842"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.169441"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.172298"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:19.170998"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.172298"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.174742"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:25:19.173572"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.174742"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('c0856809-20a4-4a78-97df-f65079cc8f56', 'c0856809-20a4-4a78-97df-f65079cc8f56') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:25:19.181317"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:25:19.181317"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.184608"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:19.182736"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.184608"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.188155"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:19.186554"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.188155"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c0856809-20a4-4a78-97df-f65079cc8f56 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:25:19.190878"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:25:19.189542"], ["state", "pending"], ["updated_at", "2014-10-21 08:25:19.190878"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:27:58.935571"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:27:58.935571"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.9ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:58.951093"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:27:58.940551"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.951093"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:58.955930"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:27:58.954136"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.955930"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:58.958441"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:27:58.957256"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.958441"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = '2123e8d0-721c-480f-9a8a-a3304dde15b8' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:27:58.969656"], ["pending_at", "2014-10-21 08:27:58.969308"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.969656"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:27:58.971679"], ["pending_at", "2014-10-21 08:27:58.971411"], ["state", "imported"], ["updated_at", "2014-10-21 08:27:58.971679"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:27:58.976403"], ["pending_at", "2014-10-21 08:27:58.976104"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.976403"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:27:58.978178"], ["pending_at", "2014-10-21 08:27:58.977913"], ["state", "imported"], ["updated_at", "2014-10-21 08:27:58.978178"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:27:58.981919"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:27:58.981919"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:58.989199"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:27:58.983303"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.989199"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:58.992535"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:27:58.991040"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.992535"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:58.995284"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:27:58.993921"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:58.995284"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) BEGIN SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:27:59.004265"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:27:59.004265"]]  (0.5ms) COMMIT -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:27:59.050816"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:27:59.050816"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:59.054046"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:27:59.052479"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:59.054046"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:59.056714"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:27:59.055396"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:59.056714"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:59.059304"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:27:59.058039"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:59.059304"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('2123e8d0-721c-480f-9a8a-a3304dde15b8', '2123e8d0-721c-480f-9a8a-a3304dde15b8') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.2ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:27:59.105426"], ["pending_at", "2014-10-21 08:27:59.105087"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:59.105426"]]  (0.4ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:27:59.116941"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:27:59.116941"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:59.120435"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:27:59.118731"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:59.120435"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:59.123226"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:27:59.121858"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:59.123226"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2123e8d0-721c-480f-9a8a-a3304dde15b8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:27:59.125988"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:27:59.124602"], ["state", "pending"], ["updated_at", "2014-10-21 08:27:59.125988"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:30:58.285107"], ["pending_at", "2014-10-21 08:30:58.284719"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.285107"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:30:58.287656"], ["pending_at", "2014-10-21 08:30:58.287330"], ["state", "imported"], ["updated_at", "2014-10-21 08:30:58.287656"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.9ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:30:58.311676"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:30:58.311676"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:30:58.326723"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:30:58.326723"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.330270"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:30:58.328444"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.330270"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.334157"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:30:58.332363"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.334157"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.336754"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:30:58.335541"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.336754"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('4b6fb94f-3861-4838-b763-96da098a5c46', '4b6fb94f-3861-4838-b763-96da098a5c46') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:30:58.357792"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:30:58.357792"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.364691"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:30:58.359358"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.364691"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.368964"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:30:58.367209"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.368964"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.373420"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:30:58.371218"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.373420"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:30:58.383712"], ["pending_at", "2014-10-21 08:30:58.383212"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.383712"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:30:58.390781"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:30:58.390781"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.393820"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:30:58.392204"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.393820"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.396539"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:30:58.395195"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.396539"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.399259"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:30:58.397866"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.399259"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:30:58.416630"], ["pending_at", "2014-10-21 08:30:58.416274"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.416630"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:30:58.418282"], ["pending_at", "2014-10-21 08:30:58.417952"], ["state", "imported"], ["updated_at", "2014-10-21 08:30:58.418282"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:30:58.424061"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:30:58.424061"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.426754"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:30:58.425350"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.426754"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.429253"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:30:58.428048"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.429253"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4b6fb94f-3861-4838-b763-96da098a5c46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:30:58.431706"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:30:58.430524"], ["state", "pending"], ["updated_at", "2014-10-21 08:30:58.431706"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" = '4b6fb94f-3861-4838-b763-96da098a5c46' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.8ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:37:33.649027"], ["pending_at", "2014-10-21 08:37:33.648591"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.649027"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:37:33.703660"], ["pending_at", "2014-10-21 08:37:33.703036"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.703660"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:37:33.706535"], ["pending_at", "2014-10-21 08:37:33.706027"], ["state", "imported"], ["updated_at", "2014-10-21 08:37:33.706535"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:37:33.723856"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:37:33.723856"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:37:33.728710"], ["pending_at", "2014-10-21 08:37:33.728328"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.728710"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:37:33.730415"], ["pending_at", "2014-10-21 08:37:33.730093"], ["state", "imported"], ["updated_at", "2014-10-21 08:37:33.730415"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:37:33.763065"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:37:33.763065"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.767007"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:37:33.765044"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.767007"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.770324"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:37:33.768914"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.770324"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.773037"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:37:33.771723"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.773037"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = '6b660342-0dee-4e79-b473-d8b8640f5e54' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:37:33.779239"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:37:33.779239"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.786932"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:37:33.780719"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.786932"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.790615"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:37:33.788973"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.790615"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.793488"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:37:33.792076"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.793488"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:37:33.807701"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:37:33.807701"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.810738"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:37:33.809192"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.810738"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.813386"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:37:33.812102"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.813386"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.815979"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:37:33.814714"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.815979"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('6b660342-0dee-4e79-b473-d8b8640f5e54', '6b660342-0dee-4e79-b473-d8b8640f5e54') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:37:33.821492"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:37:33.821492"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.824645"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:37:33.822992"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.824645"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.827467"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:37:33.826091"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.827467"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6b660342-0dee-4e79-b473-d8b8640f5e54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:37:33.830264"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:37:33.828879"], ["state", "pending"], ["updated_at", "2014-10-21 08:37:33.830264"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:40:12.490865"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:40:12.490865"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.544682"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:40:12.497147"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.544682"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.550464"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:40:12.547513"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.550464"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.554777"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:40:12.552826"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.554777"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:40:12.571434"], ["pending_at", "2014-10-21 08:40:12.571091"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.571434"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:40:12.583485"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:40:12.583485"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.586543"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:40:12.584954"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.586543"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.589262"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:40:12.587956"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.589262"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.591897"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:40:12.590610"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.591897"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:40:12.603810"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:40:12.603810"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.606864"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:40:12.605250"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.606864"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.610392"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:40:12.608935"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.610392"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.613013"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:40:12.611770"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.613013"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = 'a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:40:12.627144"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:40:12.627144"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:40:12.632456"], ["pending_at", "2014-10-21 08:40:12.632097"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.632456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:40:12.634011"], ["pending_at", "2014-10-21 08:40:12.633690"], ["state", "imported"], ["updated_at", "2014-10-21 08:40:12.634011"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:40:12.643632"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:40:12.643632"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.647234"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:40:12.645747"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.647234"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.649796"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:40:12.648602"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.649796"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:40:12.652230"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:40:12.651063"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.652230"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc', 'a3530d31-ee0b-48bd-9fab-2ef9b91b2bcc') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:40:12.669826"], ["pending_at", "2014-10-21 08:40:12.669465"], ["state", "pending"], ["updated_at", "2014-10-21 08:40:12.669826"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:40:12.671357"], ["pending_at", "2014-10-21 08:40:12.671036"], ["state", "imported"], ["updated_at", "2014-10-21 08:40:12.671357"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.8ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:24.114576"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:24.114576"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.9ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.134877"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:24.119414"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.134877"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.172419"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:24.169215"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.172419"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.176490"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:24.174776"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.176490"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:24.197806"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:24.197806"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.202330"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:24.200236"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.202330"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.206259"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:24.204425"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.206259"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.209076"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:24.207710"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.209076"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('2678ceba-ea97-4df8-95ad-c1418be03c54', '2678ceba-ea97-4df8-95ad-c1418be03c54') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:24.219571"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:24.219571"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.222407"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:24.220965"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.222407"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.224948"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:24.223723"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.224948"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.227447"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:24.226199"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.227447"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = '2678ceba-ea97-4df8-95ad-c1418be03c54' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:24.239772"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:24.239772"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.242861"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:24.241245"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.242861"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.245666"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:24.244280"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.245666"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2678ceba-ea97-4df8-95ad-c1418be03c54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:24.248511"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:24.247080"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.248511"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:24.267301"], ["pending_at", "2014-10-21 08:42:24.266942"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.267301"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:24.289695"], ["pending_at", "2014-10-21 08:42:24.289338"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.289695"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:24.291246"], ["pending_at", "2014-10-21 08:42:24.290949"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:24.291246"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:24.296252"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:24.296252"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:24.300341"], ["pending_at", "2014-10-21 08:42:24.299982"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:24.300341"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:24.301841"], ["pending_at", "2014-10-21 08:42:24.301557"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:24.301841"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.0ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:33.321998"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:33.321998"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.353806"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:33.340610"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.353806"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.359940"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:33.357287"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.359940"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.364219"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:33.362000"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.364219"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:33.406382"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:33.406382"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.409302"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:33.407795"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.409302"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.412118"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:33.410858"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.412118"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.414713"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:33.413451"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.414713"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('a847b96c-622f-4cb1-bc04-22172ad3e035', 'a847b96c-622f-4cb1-bc04-22172ad3e035') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:33.443435"], ["pending_at", "2014-10-21 08:42:33.443144"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.443435"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:33.452528"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:33.452528"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.456745"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:33.454673"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.456745"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.461466"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:33.459484"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.461466"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.464983"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:33.463453"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.464983"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = 'a847b96c-622f-4cb1-bc04-22172ad3e035' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:33.480085"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:33.480085"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.483308"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:33.481628"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.483308"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.486388"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:33.484930"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.486388"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a847b96c-622f-4cb1-bc04-22172ad3e035 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:33.489067"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:33.487768"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.489067"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:33.496041"], ["pending_at", "2014-10-21 08:42:33.495751"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.496041"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:33.497553"], ["pending_at", "2014-10-21 08:42:33.497235"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:33.497553"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:33.513272"], ["pending_at", "2014-10-21 08:42:33.512912"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:33.513272"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:33.514810"], ["pending_at", "2014-10-21 08:42:33.514530"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:33.514810"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:33.534356"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:33.534356"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:41.979250"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:41.979250"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:41.984920"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:41.982411"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:41.984920"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:41.989373"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:41.987704"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:41.989373"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:41.992054"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:41.990702"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:41.992054"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = '183227fa-cbff-4ec9-abd7-806587171599' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.4ms) ROLLBACK ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:42.034917"], ["pending_at", "2014-10-21 08:42:42.034319"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.034917"]]  (0.6ms) COMMIT S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:42.043474"], ["pending_at", "2014-10-21 08:42:42.043082"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.043474"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:42.045413"], ["pending_at", "2014-10-21 08:42:42.045131"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:42.045413"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:42.051416"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:42.051416"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.058433"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:42.052957"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.058433"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.061731"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:42.060231"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.061731"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.064460"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:42.063132"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.064460"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous ------------------------------------------------------- ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:42.092673"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:42.092673"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.095574"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:42.094119"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.095574"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.098079"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:42.096876"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.098079"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.100510"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:42.099324"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.100510"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('183227fa-cbff-4ec9-abd7-806587171599', '183227fa-cbff-4ec9-abd7-806587171599') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:42.111920"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:42.111920"]]  (0.5ms) COMMIT  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:42.115541"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:42.115541"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.118870"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:42.117017"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.118870"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.121730"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:42.120333"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.121730"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 183227fa-cbff-4ec9-abd7-806587171599 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:42.124401"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:42.123079"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.124401"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:42.128372"], ["pending_at", "2014-10-21 08:42:42.128045"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:42.128372"]]  (0.5ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:42.130234"], ["pending_at", "2014-10-21 08:42:42.129953"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:42.130234"]]  (0.3ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous ----------------------------------------------- ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:52.371817"], ["pending_at", "2014-10-21 08:42:52.371333"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.371817"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:52.376232"], ["pending_at", "2014-10-21 08:42:52.375892"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:52.376232"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:52.451609"], ["pending_at", "2014-10-21 08:42:52.451068"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.451609"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:52.453956"], ["pending_at", "2014-10-21 08:42:52.453568"], ["state", "imported"], ["updated_at", "2014-10-21 08:42:52.453956"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:52.463966"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:52.463966"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.469199"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:52.466461"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.469199"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.473494"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:52.471570"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.473494"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.476891"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:52.475335"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.476891"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('b7819639-62df-43d4-bc28-f31066a27f07', 'b7819639-62df-43d4-bc28-f31066a27f07') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 08:42:52.489927"], ["pending_at", "2014-10-21 08:42:52.489593"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.489927"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:52.507860"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:52.507860"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.510658"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:52.509269"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.510658"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.513155"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:52.511969"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.513155"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.515742"], ["filename", "cat.png"], ["pending_at", "2014-10-21 08:42:52.514400"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.515742"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = 'b7819639-62df-43d4-bc28-f31066a27f07' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:52.532136"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:52.532136"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:52.544256"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:52.544256"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.552367"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:52.545735"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.552367"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.556681"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:52.554852"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.556681"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.560072"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:52.558198"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.560072"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 08:42:52.567520"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 08:42:52.567520"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.570655"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:52.569001"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.570655"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.573541"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:52.572142"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.573541"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b7819639-62df-43d4-bc28-f31066a27f07 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 08:42:52.576271"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 08:42:52.574940"], ["state", "pending"], ["updated_at", "2014-10-21 08:42:52.576271"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (26.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:11:54.932352"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:11:54.932352"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:11:54.948124"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:11:54.948124"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (6.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:54.960198"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:11:54.950657"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:54.960198"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:54.973500"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:11:54.970263"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:54.973500"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:54.977839"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:11:54.975875"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:54.977839"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:11:54.993434"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:11:54.993434"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:54.996321"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:11:54.994892"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:54.996321"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:54.999202"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:11:54.997869"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:54.999202"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:55.001825"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:11:55.000564"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.001825"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = 'ead62907-8254-41e1-8ccd-7b03430bf2a2' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:11:55.008721"], ["pending_at", "2014-10-21 09:11:55.008410"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.008721"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:11:55.010398"], ["pending_at", "2014-10-21 09:11:55.010078"], ["state", "imported"], ["updated_at", "2014-10-21 09:11:55.010398"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:11:55.026734"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:11:55.026734"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:55.029489"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:11:55.028125"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.029489"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:55.032000"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:11:55.030787"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.032000"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:55.034569"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:11:55.033306"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.034569"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('ead62907-8254-41e1-8ccd-7b03430bf2a2', 'ead62907-8254-41e1-8ccd-7b03430bf2a2') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:11:55.044112"], ["pending_at", "2014-10-21 09:11:55.043829"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.044112"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:11:55.058815"], ["pending_at", "2014-10-21 09:11:55.058533"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.058815"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:11:55.060307"], ["pending_at", "2014-10-21 09:11:55.060001"], ["state", "imported"], ["updated_at", "2014-10-21 09:11:55.060307"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:11:55.069634"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:11:55.069634"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:55.073046"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:11:55.071167"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.073046"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:55.076125"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:11:55.074614"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.076125"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ead62907-8254-41e1-8ccd-7b03430bf2a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:11:55.078894"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:11:55.077497"], ["state", "pending"], ["updated_at", "2014-10-21 09:11:55.078894"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 500 Internal Server Error in 1ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous --------------------------------------------------------  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 500 Internal Server Error in 1ms  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:31:01.092042"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:31:01.092042"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.127965"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:31:01.119074"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.127965"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.132777"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:31:01.130912"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.132777"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.135581"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:31:01.134269"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.135581"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (1.1ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = 'c33947e8-ecc7-406c-ae2f-80a749033ae6' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:31:01.209042"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:31:01.209042"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.218582"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:31:01.211449"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.218582"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.222143"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:31:01.220531"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.222143"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.225289"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:31:01.223694"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.225289"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:31:01.234208"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:31:01.234208"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.237032"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:31:01.235620"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.237032"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.239614"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:31:01.238378"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.239614"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.242107"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:31:01.240889"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.242107"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('c33947e8-ecc7-406c-ae2f-80a749033ae6', 'c33947e8-ecc7-406c-ae2f-80a749033ae6') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:31:01.248610"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:31:01.248610"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.251662"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:31:01.250055"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.251662"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.254439"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:31:01.253076"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.254439"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c33947e8-ecc7-406c-ae2f-80a749033ae6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:31:01.257185"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:31:01.255812"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.257185"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:31:01.276333"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:31:01.276333"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:31:01.283879"], ["pending_at", "2014-10-21 09:31:01.283499"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.283879"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:31:01.285676"], ["pending_at", "2014-10-21 09:31:01.285400"], ["state", "imported"], ["updated_at", "2014-10-21 09:31:01.285676"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:31:01.296180"], ["pending_at", "2014-10-21 09:31:01.295816"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.296180"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:31:01.297771"], ["pending_at", "2014-10-21 09:31:01.297496"], ["state", "imported"], ["updated_at", "2014-10-21 09:31:01.297771"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:31:01.308371"], ["pending_at", "2014-10-21 09:31:01.308021"], ["state", "pending"], ["updated_at", "2014-10-21 09:31:01.308371"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:32:26.492292"], ["pending_at", "2014-10-21 09:32:26.491804"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.492292"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:32:26.496714"], ["pending_at", "2014-10-21 09:32:26.496372"], ["state", "imported"], ["updated_at", "2014-10-21 09:32:26.496714"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:32:26.527888"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:32:26.527888"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.570505"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:32:26.531273"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.570505"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.575255"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:32:26.572854"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.575255"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.578544"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:32:26.576596"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.578544"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (1.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = 'e1d19ed2-1370-47ec-9bbf-1a718206c229' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:32:26.603370"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:32:26.603370"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.612189"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:32:26.605347"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.612189"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.616293"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:32:26.614802"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.616293"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.619093"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:32:26.617717"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.619093"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:32:26.626252"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:32:26.626252"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.628949"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:32:26.627575"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.628949"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.631538"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:32:26.630253"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.631538"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.635143"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:32:26.633637"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.635143"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('e1d19ed2-1370-47ec-9bbf-1a718206c229', 'e1d19ed2-1370-47ec-9bbf-1a718206c229') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:32:26.645431"], ["pending_at", "2014-10-21 09:32:26.644881"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.645431"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:32:26.693504"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:32:26.693504"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.698142"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:32:26.695888"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.698142"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.702051"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:32:26.700113"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.702051"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e1d19ed2-1370-47ec-9bbf-1a718206c229 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:32:26.705444"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:32:26.703978"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.705444"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:32:26.710983"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:32:26.710983"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:32:26.715257"], ["pending_at", "2014-10-21 09:32:26.714901"], ["state", "pending"], ["updated_at", "2014-10-21 09:32:26.715257"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:32:26.716787"], ["pending_at", "2014-10-21 09:32:26.716503"], ["state", "imported"], ["updated_at", "2014-10-21 09:32:26.716787"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6dec100b-9c84-45d4-866b-ee5bafd8157d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6dec100b-9c84-45d4-866b-ee5bafd8157d :format: 1 ' LIMIT 1 SQL (0.9ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:37:49.023614"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:37:49.011829"], ["state", "pending"], ["updated_at", "2014-10-21 09:37:49.023614"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 23ms (Views: 0.3ms | ActiveRecord: 1.7ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"47223034-4b87-432d-81c9-540b33e379e2", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 47223034-4b87-432d-81c9-540b33e379e2 :format: 1 ' LIMIT 1 SQL (0.7ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:37:55.420629"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:37:55.408283"], ["state", "pending"], ["updated_at", "2014-10-21 09:37:55.420629"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 23ms (Views: 0.2ms | ActiveRecord: 1.7ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"466c06af-04d3-4758-9737-7f14a83d9109", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 466c06af-04d3-4758-9737-7f14a83d9109 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:38:03.291714"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:38:03.280246"], ["state", "pending"], ["updated_at", "2014-10-21 09:38:03.291714"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 22ms (Views: 0.3ms | ActiveRecord: 1.6ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"a38d3844-59b2-443f-8d66-c858f02d7c8f", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a38d3844-59b2-443f-8d66-c858f02d7c8f :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:38:20.365866"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:38:20.354195"], ["state", "pending"], ["updated_at", "2014-10-21 09:38:20.365866"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 23ms (Views: 0.4ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"b3c305a9-348a-4708-b06f-50b109ace09a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3c305a9-348a-4708-b06f-50b109ace09a :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:39:12.418798"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:39:12.404052"], ["state", "pending"], ["updated_at", "2014-10-21 09:39:12.418798"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 26ms (Views: 0.2ms | ActiveRecord: 1.4ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"64344772-3026-4249-91c6-ba49c7a01d2f", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 64344772-3026-4249-91c6-ba49c7a01d2f :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:40:40.541371"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:40:40.529715"], ["state", "pending"], ["updated_at", "2014-10-21 09:40:40.541371"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 23ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4a0c19af-6280-4b4e-9956-3b7fa8dfd01a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4a0c19af-6280-4b4e-9956-3b7fa8dfd01a :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:40:50.660540"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:40:50.646685"], ["state", "pending"], ["updated_at", "2014-10-21 09:40:50.660540"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 24ms (Views: 0.2ms | ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6ba4af09-2a06-44b6-b0ee-06b5296e5f4a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6ba4af09-2a06-44b6-b0ee-06b5296e5f4a :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:40:56.864871"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:40:56.853174"], ["state", "pending"], ["updated_at", "2014-10-21 09:40:56.864871"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 23ms (Views: 0.3ms | ActiveRecord: 1.6ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"121a7c1b-327a-47d2-97e4-ca341ef84198", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 121a7c1b-327a-47d2-97e4-ca341ef84198 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 61ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"25e647e9-1cff-4a51-aedc-524ddc6dfb07", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 25e647e9-1cff-4a51-aedc-524ddc6dfb07 :format: 1 ' LIMIT 1 SQL (0.7ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:41:08.862117"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:41:08.848869"], ["state", "pending"], ["updated_at", "2014-10-21 09:41:08.862117"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 30ms (Views: 0.2ms | ActiveRecord: 1.7ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (23.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.8ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:42:37.765067"], ["pending_at", "2014-10-21 09:42:37.764589"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.765067"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:42:37.779008"], ["pending_at", "2014-10-21 09:42:37.778495"], ["state", "imported"], ["updated_at", "2014-10-21 09:42:37.779008"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:42:37.807049"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:42:37.807049"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.832455"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:42:37.817019"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.832455"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.835861"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:42:37.834422"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.835861"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.838677"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:42:37.837213"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.838677"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('286ee000-f2ec-4adf-8cd6-7d2fa32e1668', '286ee000-f2ec-4adf-8cd6-7d2fa32e1668') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:42:37.884862"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:42:37.884862"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.887853"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:42:37.886412"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.887853"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.890401"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:42:37.889170"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.890401"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.892899"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:42:37.891649"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.892899"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = '286ee000-f2ec-4adf-8cd6-7d2fa32e1668' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:42:37.898344"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:42:37.898344"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.908221"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:42:37.899963"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.908221"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.911395"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:42:37.909964"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.911395"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.914149"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:42:37.912747"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.914149"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:42:37.930730"], ["pending_at", "2014-10-21 09:42:37.930368"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.930730"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:42:37.932296"], ["pending_at", "2014-10-21 09:42:37.932011"], ["state", "imported"], ["updated_at", "2014-10-21 09:42:37.932296"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:42:37.980261"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:42:37.980261"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.983472"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:42:37.981746"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.983472"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.986709"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:42:37.984991"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.986709"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 286ee000-f2ec-4adf-8cd6-7d2fa32e1668 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.989586"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:42:37.988150"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.989586"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"08e7b789-2329-4e72-a51a-46e3d821fb4b", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 08e7b789-2329-4e72-a51a-46e3d821fb4b :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:42:37.999114"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:42:37.997518"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:37.999114"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 09:42:38.013144"], ["pending_at", "2014-10-21 09:42:38.012799"], ["state", "pending"], ["updated_at", "2014-10-21 09:42:38.013144"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:42:38.019988"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:42:38.019988"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"25d529f7-408a-45b7-9629-a3504dc85720", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 25d529f7-408a-45b7-9629-a3504dc85720 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:45:39.632696"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:45:39.615442"], ["state", "pending"], ["updated_at", "2014-10-21 09:45:39.632696"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 28ms (Views: 0.2ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0002_anonymous ------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"91968b00-25ce-43f4-ae2a-fa1870822ad8", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 91968b00-25ce-43f4-ae2a-fa1870822ad8 :format: 1 ' LIMIT 1 SQL (0.8ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:45:49.606738"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:45:49.593160"], ["state", "pending"], ["updated_at", "2014-10-21 09:45:49.606738"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 26ms (Views: 0.3ms | ActiveRecord: 1.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0002_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"23948f7f-04e6-4867-89e4-87648eeb72aa", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23948f7f-04e6-4867-89e4-87648eeb72aa :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:45:57.218051"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:45:57.206646"], ["state", "pending"], ["updated_at", "2014-10-21 09:45:57.218051"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 22ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0002_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"b6e9d90f-d59c-48f3-bbc5-d185a82c6f9d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6e9d90f-d59c-48f3-bbc5-d185a82c6f9d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:45:57.229583"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:45:57.228215"], ["state", "pending"], ["updated_at", "2014-10-21 09:45:57.229583"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0001_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"fa17788e-3dae-4256-860b-bd7c921f5175", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: fa17788e-3dae-4256-860b-bd7c921f5175 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:46:03.428468"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:46:03.415931"], ["state", "pending"], ["updated_at", "2014-10-21 09:46:03.428468"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 23ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsController::POST create: test_0002_anonymous ------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"a65fddbb-0c33-43ff-8154-aa2280f6b3e4", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a65fddbb-0c33-43ff-8154-aa2280f6b3e4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:46:03.438884"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:46:03.437543"], ["state", "pending"], ["updated_at", "2014-10-21 09:46:03.438884"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.3ms | ActiveRecord: 0.8ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:48:54.729405"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:48:54.729405"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"c3ea2451-65a8-4126-b465-eef60841da4a", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c3ea2451-65a8-4126-b465-eef60841da4a :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:48:54.771344"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:48:54.763380"], ["state", "pending"], ["updated_at", "2014-10-21 09:48:54.771344"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 24ms (Views: 0.2ms | ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"129ad2e5-6e1a-4e7d-a322-9249dbaa8539", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 129ad2e5-6e1a-4e7d-a322-9249dbaa8539 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:48:54.784682"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:48:54.783188"], ["state", "pending"], ["updated_at", "2014-10-21 09:48:54.784682"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.3ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4b30a046-3715-48e2-a076-1bd4bc7edd67", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Thing", "parent_id"=>"1000"} Completed 500 Internal Server Error in 1ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:49:52.944869"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:49:52.944869"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"584e5059-c78f-48d0-a38a-e5c25462ea9a", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 584e5059-c78f-48d0-a38a-e5c25462ea9a :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:49:52.973851"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:49:52.966260"], ["state", "pending"], ["updated_at", "2014-10-21 09:49:52.973851"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 23ms (Views: 0.2ms | ActiveRecord: 1.7ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"51af64e6-df66-4627-90d3-b64669d844bb", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 51af64e6-df66-4627-90d3-b64669d844bb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:49:52.990835"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:49:52.988739"], ["state", "pending"], ["updated_at", "2014-10-21 09:49:52.990835"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:50:13.936580"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:50:13.936580"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"15a28881-ec4a-4072-8c42-b3a067b37de6", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (1.1ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 15a28881-ec4a-4072-8c42-b3a067b37de6 :format: 1 ' LIMIT 1 SQL (0.8ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:50:13.980109"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:50:13.969922"], ["state", "pending"], ["updated_at", "2014-10-21 09:50:13.980109"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 25ms (Views: 0.3ms | ActiveRecord: 2.5ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ba5fe21e-cfbf-4c9b-8d42-4cc16d4b416f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 10000000]] Completed 404 Not Found in 3ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"300cafda-5352-495b-a048-170021e731fc", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 300cafda-5352-495b-a048-170021e731fc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:50:14.053587"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:50:14.052204"], ["state", "pending"], ["updated_at", "2014-10-21 09:50:14.053587"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"3501af03-074d-4f63-8a34-18c5bb39b0ae", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 3501af03-074d-4f63-8a34-18c5bb39b0ae :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:52:56.659555"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:52:56.646668"], ["state", "pending"], ["updated_at", "2014-10-21 09:52:56.659555"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 24ms (Views: 0.2ms | ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:52:56.678284"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:52:56.678284"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"e45fb74d-0089-4a17-8cb1-c1e57d612e86", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e45fb74d-0089-4a17-8cb1-c1e57d612e86 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:52:56.691081"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:52:56.688706"], ["state", "pending"], ["updated_at", "2014-10-21 09:52:56.691081"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 8ms (Views: 0.2ms | ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"01d591e6-0963-4d81-a02c-d461488e5882", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 10000000]] Completed 404 Not Found in 2ms  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"36eef35c-35b4-49b1-9075-b76e49271dbc", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 36eef35c-35b4-49b1-9075-b76e49271dbc :format: 1 ' LIMIT 1 SQL (0.8ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:54:48.959518"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:54:48.947321"], ["state", "pending"], ["updated_at", "2014-10-21 09:54:48.959518"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 36ms (Views: 0.3ms | ActiveRecord: 4.0ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:54:48.971311"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:54:48.971311"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"29befe62-c669-4e07-a010-cda7d1f19fae", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 29befe62-c669-4e07-a010-cda7d1f19fae :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:54:48.979929"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:54:48.978580"], ["state", "pending"], ["updated_at", "2014-10-21 09:54:48.979929"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.4ms | ActiveRecord: 1.1ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"fe3b3740-b4d8-4995-aaa8-d9ab0cf3e7f1", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: fe3b3740-b4d8-4995-aaa8-d9ab0cf3e7f1 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:54:49.024603"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:54:49.023271"], ["state", "pending"], ["updated_at", "2014-10-21 09:54:49.024603"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.3ms | ActiveRecord: 0.8ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"fbcabcbe-368f-4153-98ab-f33929b72cb5", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: fbcabcbe-368f-4153-98ab-f33929b72cb5 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:55:21.416369"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:55:21.405284"], ["state", "pending"], ["updated_at", "2014-10-21 09:55:21.416369"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 40ms (Views: 0.3ms | ActiveRecord: 3.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8c66a176-fc09-4ac5-a627-7e591032ba41", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c66a176-fc09-4ac5-a627-7e591032ba41 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:55:21.429404"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:55:21.427347"], ["state", "pending"], ["updated_at", "2014-10-21 09:55:21.429404"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:55:21.444126"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:55:21.444126"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"abee40b6-54c4-4f28-b316-c9352d33469b", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: abee40b6-54c4-4f28-b316-c9352d33469b :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:55:21.453443"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:55:21.450748"], ["state", "pending"], ["updated_at", "2014-10-21 09:55:21.453443"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 8ms (Views: 0.2ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ce8a0dac-4422-4f30-b370-d081877229a3", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ce8a0dac-4422-4f30-b370-d081877229a3 :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:55:31.912356"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:55:31.900184"], ["state", "pending"], ["updated_at", "2014-10-21 09:55:31.912356"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 24ms (Views: 0.3ms | ActiveRecord: 1.7ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:55:31.937632"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:55:31.937632"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"73d46a26-eb83-44de-8ba6-35b4e93ce0e7", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 73d46a26-eb83-44de-8ba6-35b4e93ce0e7 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:55:31.952932"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:55:31.950888"], ["state", "pending"], ["updated_at", "2014-10-21 09:55:31.952932"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 9ms (Views: 0.3ms | ActiveRecord: 1.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8b4d1d2a-791b-4a95-b0eb-50f6845665b0", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8b4d1d2a-791b-4a95-b0eb-50f6845665b0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:55:31.968318"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:55:31.967007"], ["state", "pending"], ["updated_at", "2014-10-21 09:55:31.968318"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ab8c6dc1-6840-4c6b-8699-fec94bf7dda3", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ab8c6dc1-6840-4c6b-8699-fec94bf7dda3 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:56:20.447074"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:56:20.433529"], ["state", "pending"], ["updated_at", "2014-10-21 09:56:20.447074"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 26ms (Views: 0.3ms | ActiveRecord: 1.7ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:56:20.469385"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:56:20.469385"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"2debded5-5ee9-4aa0-8f7f-05cd21e05a9c", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2debded5-5ee9-4aa0-8f7f-05cd21e05a9c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:56:20.481739"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:56:20.478916"], ["state", "pending"], ["updated_at", "2014-10-21 09:56:20.481739"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"24ee4e24-2e88-4d00-929b-6eed17a6de9f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 24ee4e24-2e88-4d00-929b-6eed17a6de9f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:56:20.529676"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:56:20.528186"], ["state", "pending"], ["updated_at", "2014-10-21 09:56:20.529676"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"b3f3e258-980a-42b7-850b-c6a0497aad38", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b3f3e258-980a-42b7-850b-c6a0497aad38 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 71ms (Views: 0.2ms | ActiveRecord: 2.8ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:57:15.827893"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:57:15.827893"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"d195cce1-291c-4460-b30a-bda626224277", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: d195cce1-291c-4460-b30a-bda626224277 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:57:15.839746"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:57:15.838209"], ["state", "pending"], ["updated_at", "2014-10-21 09:57:15.839746"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 8ms (Views: 0.2ms | ActiveRecord: 1.4ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"dfd758b4-dad5-42f5-9666-9d54309f84d9", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: dfd758b4-dad5-42f5-9666-9d54309f84d9 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:57:15.852101"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:57:15.850809"], ["state", "pending"], ["updated_at", "2014-10-21 09:57:15.852101"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"a80733f9-2cab-4ce8-98f0-bdc83e0bd0b4", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a80733f9-2cab-4ce8-98f0-bdc83e0bd0b4 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:57:22.979167"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:57:22.967086"], ["state", "pending"], ["updated_at", "2014-10-21 09:57:22.979167"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 35ms (Views: 0.3ms | ActiveRecord: 3.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"87347513-df57-4132-8733-906cb6b7cd42", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 87347513-df57-4132-8733-906cb6b7cd42 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:57:22.991382"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:57:22.989965"], ["state", "pending"], ["updated_at", "2014-10-21 09:57:22.991382"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:57:23.002625"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:57:23.002625"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"26ae44cb-d056-4d96-ade4-931891502652", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 26ae44cb-d056-4d96-ade4-931891502652 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:57:23.009900"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:57:23.008532"], ["state", "pending"], ["updated_at", "2014-10-21 09:57:23.009900"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.4ms | ActiveRecord: 1.2ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:58:19.141716"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:58:19.141716"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"0bbc07f0-154e-4fa7-9e20-d391b08a2347", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0bbc07f0-154e-4fa7-9e20-d391b08a2347 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:58:19.178070"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:58:19.169077"], ["state", "pending"], ["updated_at", "2014-10-21 09:58:19.178070"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 22ms (Views: 0.5ms | ActiveRecord: 1.9ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4c96840e-ab45-41fd-a5a8-fa383e6cc9fb", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4c96840e-ab45-41fd-a5a8-fa383e6cc9fb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:58:19.199592"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:58:19.198227"], ["state", "pending"], ["updated_at", "2014-10-21 09:58:19.199592"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"3334b1fc-4b12-4876-b21c-79745188f0f8", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 3334b1fc-4b12-4876-b21c-79745188f0f8 :format: 1 ' LIMIT 1 SQL (0.9ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:59:01.671392"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:59:01.660501"], ["state", "pending"], ["updated_at", "2014-10-21 09:59:01.671392"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 36ms (Views: 0.2ms | ActiveRecord: 4.2ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 09:59:01.682891"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 09:59:01.682891"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"edc0deb7-9c63-4f8a-9eeb-366767cd557f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: edc0deb7-9c63-4f8a-9eeb-366767cd557f :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:59:01.693120"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 09:59:01.690485"], ["state", "pending"], ["updated_at", "2014-10-21 09:59:01.693120"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 8ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (3.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"c3116af1-16b7-4d2c-987f-77a4b1726086", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c3116af1-16b7-4d2c-987f-77a4b1726086 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 09:59:01.741896"], ["filename", "cat.png"], ["pending_at", "2014-10-21 09:59:01.740583"], ["state", "pending"], ["updated_at", "2014-10-21 09:59:01.741896"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.1ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"bf92d7fe-ea8d-4bc7-9b20-f2e25a04a223", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bf92d7fe-ea8d-4bc7-9b20-f2e25a04a223 :format: 1 ' LIMIT 1 SQL (0.9ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:00:22.105092"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:00:22.092546"], ["state", "pending"], ["updated_at", "2014-10-21 10:00:22.105092"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 25ms (Views: 0.3ms | ActiveRecord: 1.8ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"3fbad866-1e79-4c63-a88c-8b79e96eae29", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 3fbad866-1e79-4c63-a88c-8b79e96eae29 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:00:22.131046"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:00:22.129666"], ["state", "pending"], ["updated_at", "2014-10-21 10:00:22.131046"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 15ms (Views: 0.2ms | ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:00:22.177135"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:00:22.177135"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"5ca98ce4-1c34-4b68-8cbd-a631f3a16f1a", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5ca98ce4-1c34-4b68-8cbd-a631f3a16f1a :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:00:22.186850"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:00:22.185305"], ["state", "pending"], ["updated_at", "2014-10-21 10:00:22.186850"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"a0b8cf90-d336-4151-965b-ed53d4ee47ea", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a0b8cf90-d336-4151-965b-ed53d4ee47ea :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 7ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7c9427fe-4a7f-4d02-8ee5-4190c05fa6cc", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7c9427fe-4a7f-4d02-8ee5-4190c05fa6cc :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:00:30.149393"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:00:30.135292"], ["state", "pending"], ["updated_at", "2014-10-21 10:00:30.149393"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 36ms (Views: 0.3ms | ActiveRecord: 3.4ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:00:30.164233"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:00:30.164233"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"f264dfc2-e670-492d-a0f5-3b6c709b570c", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f264dfc2-e670-492d-a0f5-3b6c709b570c :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:00:30.172237"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:00:30.170888"], ["state", "pending"], ["updated_at", "2014-10-21 10:00:30.172237"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.4ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"f67d4ee0-ef4f-45d1-9b91-cc85107b0c47", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f67d4ee0-ef4f-45d1-9b91-cc85107b0c47 :format: 1 ' LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 42ms (Views: 0.3ms | ActiveRecord: 0.7ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"5192736f-10b3-4b27-aadb-c579c1344175", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5192736f-10b3-4b27-aadb-c579c1344175 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:00:30.245479"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:00:30.244138"], ["state", "pending"], ["updated_at", "2014-10-21 10:00:30.245479"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:01:33.609561"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:01:33.609561"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8a8d571f-947e-4413-9d61-4a8278d57525", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a8d571f-947e-4413-9d61-4a8278d57525 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:01:33.649810"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:01:33.638701"], ["state", "pending"], ["updated_at", "2014-10-21 10:01:33.649810"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 24ms (Views: 0.3ms | ActiveRecord: 1.7ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"fb0c116b-9ff4-4dfb-89a5-6c0a3887e2ab", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: fb0c116b-9ff4-4dfb-89a5-6c0a3887e2ab :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:01:33.664111"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:01:33.662237"], ["state", "pending"], ["updated_at", "2014-10-21 10:01:33.664111"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"af8b21b3-bde6-45f1-adda-b293494b81ed", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: af8b21b3-bde6-45f1-adda-b293494b81ed :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:01:33.707288"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:01:33.705403"], ["state", "pending"], ["updated_at", "2014-10-21 10:01:33.707288"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"e5836a20-9bb4-46ef-978d-aca02a64d370", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e5836a20-9bb4-46ef-978d-aca02a64d370 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 11ms (Views: 0.2ms | ActiveRecord: 0.8ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"37f2248f-2eae-4945-abe1-81f01549ef2a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 37f2248f-2eae-4945-abe1-81f01549ef2a :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 60ms (Views: 0.3ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"15b095c3-c84a-4656-8d7c-9ae9e9f50ba6", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 15b095c3-c84a-4656-8d7c-9ae9e9f50ba6 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:01:46.011405"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:01:46.010014"], ["state", "pending"], ["updated_at", "2014-10-21 10:01:46.011405"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 16ms (Views: 0.2ms | ActiveRecord: 2.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8195dc99-7a2d-41d8-85bc-8d694a0a9381", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8195dc99-7a2d-41d8-85bc-8d694a0a9381 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:01:46.024548"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:01:46.022896"], ["state", "pending"], ["updated_at", "2014-10-21 10:01:46.024548"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:01:46.033211"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:01:46.033211"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"5f1039bc-994e-415f-87ed-9eb78015d9fa", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5f1039bc-994e-415f-87ed-9eb78015d9fa :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:01:46.041007"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:01:46.039281"], ["state", "pending"], ["updated_at", "2014-10-21 10:01:46.041007"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.4ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:01.558390"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:01.558390"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"571b6921-62dd-4684-97c7-e9aa86147e84", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 571b6921-62dd-4684-97c7-e9aa86147e84 :format: 1 ' LIMIT 1 SQL (0.7ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:01.593775"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:01.586082"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:01.593775"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 22ms (Views: 0.3ms | ActiveRecord: 2.1ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"accae0e4-dc0b-4a96-8626-e7c9c145ed31", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: accae0e4-dc0b-4a96-8626-e7c9c145ed31 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:01.618180"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:01.616893"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:01.618180"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"107c661d-aa44-4839-9318-1c3a485787a9", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 107c661d-aa44-4839-9318-1c3a485787a9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:01.664360"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:01.662731"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:01.664360"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"8180c8d7-b079-4f4b-a061-ec55ef252041", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8180c8d7-b079-4f4b-a061-ec55ef252041 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 8ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"1182e2a9-695c-4e6d-95aa-d3b7f28441f9", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 1182e2a9-695c-4e6d-95aa-d3b7f28441f9 :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.514758"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.501296"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.514758"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 35ms (Views: 0.4ms | ActiveRecord: 3.4ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:08.561432"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:08.561432"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.565512"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.563885"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.565512"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.568303"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.566996"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.568303"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.571608"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.570074"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.571608"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('164411fe-7c59-41f5-8f39-4029c6814dee', '164411fe-7c59-41f5-8f39-4029c6814dee') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7313fd56-862c-4f58-a440-870179420681", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7313fd56-862c-4f58-a440-870179420681 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.599119"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.597680"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.599119"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:08.614111"], ["pending_at", "2014-10-21 10:02:08.613714"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.614111"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:08.615745"], ["pending_at", "2014-10-21 10:02:08.615489"], ["state", "imported"], ["updated_at", "2014-10-21 10:02:08.615745"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:08.638220"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:08.638220"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"796025ca-73a1-4409-bfd4-1ac36cf78511", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"2"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 2 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 796025ca-73a1-4409-bfd4-1ac36cf78511 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.646638"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:08.645132"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.646638"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:08.653533"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:08.653533"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.656656"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.655111"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.656656"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.659267"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.658029"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.659267"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.661921"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:08.660668"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.661921"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.2ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = '164411fe-7c59-41f5-8f39-4029c6814dee' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"886e838b-f89a-4784-b966-a00d38d6bc23", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 886e838b-f89a-4784-b966-a00d38d6bc23 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:08.679340"], ["pending_at", "2014-10-21 10:02:08.678821"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.679340"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:08.681336"], ["pending_at", "2014-10-21 10:02:08.681057"], ["state", "imported"], ["updated_at", "2014-10-21 10:02:08.681336"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:08.689358"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:08.689358"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.696187"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:08.690817"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.696187"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.700418"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:08.698056"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.700418"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.703808"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:08.702128"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.703808"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:08.710078"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:08.710078"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:08.727688"], ["pending_at", "2014-10-21 10:02:08.727336"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.727688"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:08.737846"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:08.737846"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.740714"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:08.739232"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.740714"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.743450"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:08.742092"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.743450"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 164411fe-7c59-41f5-8f39-4029c6814dee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:08.746099"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:08.744783"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:08.746099"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"f43331a6-cc34-4af9-87b1-315f9978b2fd", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.9ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f43331a6-cc34-4af9-87b1-315f9978b2fd :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 57ms (Views: 0.2ms | ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:41.173862"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:41.173862"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.178442"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.176791"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.178442"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.181924"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.180516"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.181924"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.184480"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.183297"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.184480"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = 'f2a4acb4-fc8f-41b4-bdef-11bdc7918967' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:41.197350"], ["pending_at", "2014-10-21 10:02:41.196999"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.197350"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:41.210661"], ["pending_at", "2014-10-21 10:02:41.210302"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.210661"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:41.212199"], ["pending_at", "2014-10-21 10:02:41.211897"], ["state", "imported"], ["updated_at", "2014-10-21 10:02:41.212199"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:41.228641"], ["pending_at", "2014-10-21 10:02:41.228270"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.228641"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:02:41.230235"], ["pending_at", "2014-10-21 10:02:41.229915"], ["state", "imported"], ["updated_at", "2014-10-21 10:02:41.230235"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:41.244043"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:41.244043"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.252239"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:41.246093"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.252239"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.255808"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:41.254269"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.255808"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.258523"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:41.257193"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.258523"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:41.264950"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:41.264950"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"3863ddec-570d-4b4d-9c64-bb67b36c5956", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"3"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 3 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 3863ddec-570d-4b4d-9c64-bb67b36c5956 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.271879"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:41.270578"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.271879"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.4ms | ActiveRecord: 1.1ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"80fc5a3d-c218-4a31-b29c-f4122686ed12", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 80fc5a3d-c218-4a31-b29c-f4122686ed12 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.286564"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.285024"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.286564"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.3ms | ActiveRecord: 0.8ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:41.308269"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:41.308269"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.311366"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:41.309775"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.311366"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.314206"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:41.312798"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.314206"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.316980"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:02:41.315609"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.316980"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:41.327295"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:41.327295"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.330008"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.328636"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.330008"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.332529"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.331336"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.332529"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f2a4acb4-fc8f-41b4-bdef-11bdc7918967 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.335049"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.333824"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.335049"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('f2a4acb4-fc8f-41b4-bdef-11bdc7918967', 'f2a4acb4-fc8f-41b4-bdef-11bdc7918967') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"f9d842d4-7fd7-42eb-bb2c-6be41f5be2d7", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f9d842d4-7fd7-42eb-bb2c-6be41f5be2d7 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:02:41.347661"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:02:41.345175"], ["state", "pending"], ["updated_at", "2014-10-21 10:02:41.347661"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:02:41.357680"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:02:41.357680"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:28.420729"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:28.420729"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.452557"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:28.439198"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.452557"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.458451"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:28.455487"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.458451"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.461901"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:28.460130"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.461901"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.8ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:28.473054"], ["pending_at", "2014-10-21 10:03:28.472511"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.473054"]]  (0.4ms) COMMIT  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:28.476089"], ["pending_at", "2014-10-21 10:03:28.475802"], ["state", "imported"], ["updated_at", "2014-10-21 10:03:28.476089"]]  (0.4ms) COMMIT S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported' -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:28.528965"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:28.528965"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.532124"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:28.530525"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.532124"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.535177"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:28.533788"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.535177"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.537962"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:28.536614"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.537962"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = '5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:28.543697"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:28.543697"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.546743"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:28.545134"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.546743"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.549476"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:28.548129"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.549476"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.552174"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:28.550812"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.552174"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous -------------------------------------------------- ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) BEGIN SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:28.562159"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:28.562159"]]  (0.4ms) COMMIT ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) BEGIN SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:28.587832"], ["pending_at", "2014-10-21 10:03:28.587477"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.587832"]]  (0.4ms) COMMIT S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1 ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:28.609606"], ["pending_at", "2014-10-21 10:03:28.609289"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.609606"]]  (0.5ms) COMMIT  (0.2ms) BEGIN SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:28.612382"], ["pending_at", "2014-10-21 10:03:28.611710"], ["state", "imported"], ["updated_at", "2014-10-21 10:03:28.612382"]]  (0.5ms) COMMIT S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending' --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:28.624171"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:28.624171"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.627209"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:28.625603"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.627209"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.629754"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:28.628557"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.629754"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:28.632185"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:28.630992"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:28.632185"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c', '5fa4fe3d-d66e-4ace-b7b5-6e3ba711fc2c') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous ----------------------------------------------- ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) BEGIN S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) BEGIN SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:28.647376"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:28.647376"]]  (0.4ms) COMMIT  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ---------------------------------------------------------- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7a86d7e6-5449-44eb-a598-5e5298192046", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7a86d7e6-5449-44eb-a598-5e5298192046 :format: 1 ' LIMIT 1 SQL (0.9ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.063910"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.062079"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.063910"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 17ms (Views: 0.4ms | ActiveRecord: 3.4ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:35.072666"], ["pending_at", "2014-10-21 10:03:35.072247"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.072666"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:35.074895"], ["pending_at", "2014-10-21 10:03:35.074497"], ["state", "imported"], ["updated_at", "2014-10-21 10:03:35.074895"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:35.083972"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:35.083972"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.092180"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:35.086501"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.092180"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.097689"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:35.095130"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.097689"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.101812"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:35.099846"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.101812"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:35.112370"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:35.112370"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:35.119261"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:35.119261"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.122109"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.120604"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.122109"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.124627"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.123417"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.124627"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.127076"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.125870"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.127076"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = '2c8cb90e-a571-473d-b1db-e4b58d1719d0' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:35.139584"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:35.139584"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.142335"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.140925"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.142335"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (1.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.150012"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.145298"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.150012"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.154846"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.152905"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.154846"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (1.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('2c8cb90e-a571-473d-b1db-e4b58d1719d0', '2c8cb90e-a571-473d-b1db-e4b58d1719d0') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:35.164994"], ["pending_at", "2014-10-21 10:03:35.164640"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.164994"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:35.166493"], ["pending_at", "2014-10-21 10:03:35.166208"], ["state", "imported"], ["updated_at", "2014-10-21 10:03:35.166493"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"c96df14d-96cb-4aee-be93-09eb1d6887f4", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c96df14d-96cb-4aee-be93-09eb1d6887f4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.179074"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:03:35.177118"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.179074"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:35.205029"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:35.205029"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7d2fd162-99c8-4011-9dc7-e83f448c32c1", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 5 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7d2fd162-99c8-4011-9dc7-e83f448c32c1 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.212766"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:35.211109"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.212766"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"596af071-9f56-4a07-8943-afd369d53d68", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 596af071-9f56-4a07-8943-afd369d53d68 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:03:35.247361"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:03:35.247361"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.250620"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:35.248902"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.250620"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.254409"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:35.252266"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.254409"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c8cb90e-a571-473d-b1db-e4b58d1719d0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:03:35.258207"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:03:35.256255"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.258207"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:03:35.278030"], ["pending_at", "2014-10-21 10:03:35.277710"], ["state", "pending"], ["updated_at", "2014-10-21 10:03:35.278030"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:04:08.320755"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:04:08.320755"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.327312"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.324662"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.327312"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.331405"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.329759"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.331405"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.334496"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.332850"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.334496"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = '8a418d87-ab9a-452c-a3a7-d825d6fb132e' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:04:08.349065"], ["pending_at", "2014-10-21 10:04:08.348538"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.349065"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:04:08.351641"], ["pending_at", "2014-10-21 10:04:08.351236"], ["state", "imported"], ["updated_at", "2014-10-21 10:04:08.351641"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6aa916f4-f7f8-42cb-bf8f-98937c985ed8", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6aa916f4-f7f8-42cb-bf8f-98937c985ed8 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.380610"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.378958"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.380610"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:04:08.387550"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:04:08.387550"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.397621"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:04:08.390030"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.397621"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.401485"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:04:08.399716"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.401485"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.404888"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:04:08.403213"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.404888"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:04:08.411697"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:04:08.411697"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:04:08.421272"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:04:08.421272"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"bce106b6-183f-4d8a-bb22-00e999c95e7c", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"4"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 4 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bce106b6-183f-4d8a-bb22-00e999c95e7c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.429163"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:04:08.427718"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.429163"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"649150db-18b0-4c30-97f3-5123ae096336", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 649150db-18b0-4c30-97f3-5123ae096336 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:04:08.456197"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:04:08.456197"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.460144"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.458354"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.460144"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.463082"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.461665"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.463082"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.465852"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.464504"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.465852"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('8a418d87-ab9a-452c-a3a7-d825d6fb132e', '8a418d87-ab9a-452c-a3a7-d825d6fb132e') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:04:08.486393"], ["pending_at", "2014-10-21 10:04:08.485898"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.486393"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"f95f86ad-19c5-4db6-a73a-aacf82269aee", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f95f86ad-19c5-4db6-a73a-aacf82269aee :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.501300"], ["filename", "cat.png"], ["pending_at", "2014-10-21 10:04:08.499895"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.501300"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:04:08.506262"], ["pending_at", "2014-10-21 10:04:08.505877"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.506262"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 10:04:08.508097"], ["pending_at", "2014-10-21 10:04:08.507696"], ["state", "imported"], ["updated_at", "2014-10-21 10:04:08.508097"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 10:04:08.526981"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 10:04:08.526981"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.530318"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:04:08.528545"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.530318"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.533523"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:04:08.531918"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.533523"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a418d87-ab9a-452c-a3a7-d825d6fb132e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 10:04:08.536591"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 10:04:08.535040"], ["state", "pending"], ["updated_at", "2014-10-21 10:04:08.536591"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (25.2ms) SELECT "schema_migrations".* FROM "schema_migrations"  (7.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (9.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (13.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (17.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:39.314323"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:39.314323"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (12.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (6.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.375792"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.350584"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.375792"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.388756"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.386102"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.388756"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.393568"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.391423"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.393568"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.5ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('8ee0116f-9a12-4648-b9a6-554f1f0d1c6d', '8ee0116f-9a12-4648-b9a6-554f1f0d1c6d') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (6.1ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:39.438647"], ["pending_at", "2014-10-21 19:27:39.438247"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.438647"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:39.440585"], ["pending_at", "2014-10-21 19:27:39.440281"], ["state", "imported"], ["updated_at", "2014-10-21 19:27:39.440585"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:39.444980"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:39.444980"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.456457"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:39.446974"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.456457"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.460118"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:39.458499"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.460118"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.463153"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:39.461647"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.463153"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:39.475877"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:39.475877"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"dd3dd22f-90d1-46c3-9eaa-75632c92ae97", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"3"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 3 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: dd3dd22f-90d1-46c3-9eaa-75632c92ae97 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.486231"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:39.484646"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.486231"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"2898ed6c-1b03-4295-8ad2-106f47df23d3", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2898ed6c-1b03-4295-8ad2-106f47df23d3 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:39.515919"], ["pending_at", "2014-10-21 19:27:39.515463"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.515919"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ea768773-804a-4fef-83e3-8dd3df7c24c5", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ea768773-804a-4fef-83e3-8dd3df7c24c5 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.532267"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.530821"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.532267"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:39.541869"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:39.541869"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.544994"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.543399"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.544994"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.547879"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.546468"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.547879"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.550884"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.549375"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.550884"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" = '8ee0116f-9a12-4648-b9a6-554f1f0d1c6d' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"3e2563f6-0f55-4cf3-a52a-e7aafb0da482", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 3e2563f6-0f55-4cf3-a52a-e7aafb0da482 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.585750"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:39.583694"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.585750"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:39.601033"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:39.601033"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.604562"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:39.602773"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.604562"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.607679"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:39.606143"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.607679"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8ee0116f-9a12-4648-b9a6-554f1f0d1c6d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:39.610728"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:39.609210"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.610728"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:39.617520"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:39.617520"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:39.625776"], ["pending_at", "2014-10-21 19:27:39.625380"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:39.625776"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:39.627473"], ["pending_at", "2014-10-21 19:27:39.627133"], ["state", "imported"], ["updated_at", "2014-10-21 19:27:39.627473"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:50.362566"], ["pending_at", "2014-10-21 19:27:50.361871"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.362566"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:50.366280"], ["pending_at", "2014-10-21 19:27:50.365783"], ["state", "imported"], ["updated_at", "2014-10-21 19:27:50.366280"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:50.386364"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:50.386364"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4d6b74ad-0074-4872-8c00-1c1767cc5872", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4d6b74ad-0074-4872-8c00-1c1767cc5872 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.402823"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:50.400578"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.402823"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 9ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:50.410284"], ["pending_at", "2014-10-21 19:27:50.409919"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.410284"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:50.411988"], ["pending_at", "2014-10-21 19:27:50.411644"], ["state", "imported"], ["updated_at", "2014-10-21 19:27:50.411988"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"f6f33947-1308-41ea-8769-8384ad918425", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f6f33947-1308-41ea-8769-8384ad918425 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:50.427456"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:50.427456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"9953693f-9bc4-44db-9c85-3304bab55a4f", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9953693f-9bc4-44db-9c85-3304bab55a4f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.448403"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.446842"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.448403"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"3825146a-cef9-4741-ab45-07c01f29adff", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 3825146a-cef9-4741-ab45-07c01f29adff :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.463415"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.461999"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.463415"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:50.475088"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:50.475088"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.478966"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.477266"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.478966"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.482158"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.480681"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.482158"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.485011"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.483658"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.485011"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('b6b00f51-a934-4e65-adbb-a557e12ee05e', 'b6b00f51-a934-4e65-adbb-a557e12ee05e') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:50.496451"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:50.496451"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.503913"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:50.498030"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.503913"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.508538"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:50.505632"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.508538"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.513171"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:50.511002"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.513171"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:50.527170"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:50.527170"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.530430"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.528795"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.530430"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.533272"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.531923"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.533272"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.535978"], ["filename", "cat.png"], ["pending_at", "2014-10-21 19:27:50.534651"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.535978"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" = 'b6b00f51-a934-4e65-adbb-a557e12ee05e' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 19:27:50.554642"], ["pending_at", "2014-10-21 19:27:50.554252"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.554642"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 19:27:50.561051"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 19:27:50.561051"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.564262"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:50.562533"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.564262"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.567478"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:50.565857"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.567478"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6b00f51-a934-4e65-adbb-a557e12ee05e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 19:27:50.570598"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 19:27:50.569026"], ["state", "pending"], ["updated_at", "2014-10-21 19:27:50.570598"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (3.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (14.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" Migrating to CreateS3RelayUploads (20141009000804)  (0.1ms) BEGIN  (4.4ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying(255), "parent_id" integer, "upload_type" character varying(255), "filename" text, "content_type" character varying(255), "state" character varying(255), "data" json DEFAULT '{}', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)  SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141009000804"]]  (1.2ms) COMMIT Migrating to CreateProducts (20141021002149)  (0.3ms) BEGIN  (2.6ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying(255), "created_at" timestamp, "updated_at" timestamp)  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141021002149"]]  (0.5ms) COMMIT ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (7.7ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (18.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:20:19.452269"], ["pending_at", "2014-10-21 22:20:19.451784"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.452269"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:20:19.463922"], ["pending_at", "2014-10-21 22:20:19.463561"], ["state", "imported"], ["updated_at", "2014-10-21 22:20:19.463922"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:20:19.492111"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:20:19.492111"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"9c737df4-7849-4134-bf33-ede10d0d47a2", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1 Completed 500 Internal Server Error in 5ms  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:20:19.519852"], ["pending_at", "2014-10-21 22:20:19.519481"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.519852"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:20:19.521540"], ["pending_at", "2014-10-21 22:20:19.521240"], ["state", "imported"], ["updated_at", "2014-10-21 22:20:19.521540"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"2394e12b-8325-4454-b71a-49cd349f51ae", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1 Completed 500 Internal Server Error in 2ms  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:20:19.594421"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:20:19.594421"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.599340"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:19.596580"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.599340"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.603138"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:19.601732"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.603138"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.605846"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:19.604526"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.605846"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('23025bd6-ed20-4d45-914e-c761ebec053c', '23025bd6-ed20-4d45-914e-c761ebec053c') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"b6abfbca-3bc0-44ef-9f61-c3433bc49a76", "filename"=>"cat.png", "content_type"=>"image/png"} Completed 500 Internal Server Error in 1ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:20:19.649500"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:20:19.649500"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.652832"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:19.651017"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.652832"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.656320"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:19.654537"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.656320"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.659186"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:19.657798"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.659186"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = '23025bd6-ed20-4d45-914e-c761ebec053c' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:20:19.667839"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:20:19.667839"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"2d748384-6f29-4973-8483-bd653b3d17f3", "filename"=>"cat.png", "content_type"=>"image/png"} Completed 500 Internal Server Error in 1ms  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:20:19.688051"], ["pending_at", "2014-10-21 22:20:19.687505"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.688051"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:20:19.701754"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:20:19.701754"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.711720"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:20:19.703305"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.711720"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.714967"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:20:19.713484"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.714967"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.717759"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:20:19.716345"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.717759"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:20:19.727553"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:20:19.727553"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.730596"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:20:19.729000"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.730596"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.733365"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:20:19.732008"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.733365"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23025bd6-ed20-4d45-914e-c761ebec053c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:19.736422"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:20:19.735030"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:19.736422"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"0b534c95-1c72-4333-a847-338e2c2ba7de", "filename"=>"cat.png", "content_type"=>"image/png"} Completed 500 Internal Server Error in 1ms  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"82fa9e3b-79e4-43f7-b19b-a4f2dd6cb11f", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 82fa9e3b-79e4-43f7-b19b-a4f2dd6cb11f :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:34.832154"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:34.820390"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:34.832154"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 24ms (Views: 0.4ms | ActiveRecord: 1.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8c22125c-f6b2-46af-82a0-67ab421bf441", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c22125c-f6b2-46af-82a0-67ab421bf441 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:34.867581"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:34.866178"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:34.867581"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 15ms (Views: 0.4ms | ActiveRecord: 2.7ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:20:34.912319"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:20:34.912319"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7382c28b-6c46-4d9f-845c-55a435104679", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7382c28b-6c46-4d9f-845c-55a435104679 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:34.920839"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:34.919456"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:34.920839"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"e4d24b24-8577-40a2-9137-e064c56ea131", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e4d24b24-8577-40a2-9137-e064c56ea131 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:20:34.932907"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:20:34.931022"], ["state", "pending"], ["updated_at", "2014-10-21 22:20:34.932907"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"e48a404c-1a2d-45a4-8379-d98ab16683a0", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e48a404c-1a2d-45a4-8379-d98ab16683a0 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 7ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"927630b6-740c-4fd7-a00f-e8500a01d941", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 927630b6-740c-4fd7-a00f-e8500a01d941 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 63ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"86bb7fdb-9bd6-4ca1-a472-dcc83a7ebc57", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 86bb7fdb-9bd6-4ca1-a472-dcc83a7ebc57 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:00.351612"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:00.349615"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:00.351612"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:22:00.380136"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:22:00.380136"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"34addc0b-a755-41f7-9fe5-59ee7243caf5", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 34addc0b-a755-41f7-9fe5-59ee7243caf5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:00.395494"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:00.393923"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:00.395494"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8a6d2301-b24d-4421-bae3-91a5dc7479dd", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8a6d2301-b24d-4421-bae3-91a5dc7479dd :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:00.407444"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:00.406098"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:00.407444"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.3ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"2d798a43-8ca8-4102-9764-48ed1d997046", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2d798a43-8ca8-4102-9764-48ed1d997046 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:00.422875"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:00.421386"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:00.422875"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"b37233d9-d2b7-4cd3-9036-bddcee5b21c5", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b37233d9-d2b7-4cd3-9036-bddcee5b21c5 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:14.680153"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:14.667166"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:14.680153"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 24ms (Views: 0.3ms | ActiveRecord: 1.4ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:22:14.702650"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:22:14.702650"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4111fcbb-45a2-45be-863a-725a09054592", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4111fcbb-45a2-45be-863a-725a09054592 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:14.713998"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:14.712463"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:14.713998"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 9ms (Views: 0.2ms | ActiveRecord: 1.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"b9e9f793-0af7-432c-b515-5a74f8de5147", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b9e9f793-0af7-432c-b515-5a74f8de5147 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:14.795312"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:14.793861"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:14.795312"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 60ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"e2b28ac6-3529-4c02-80df-e21ae676783b", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e2b28ac6-3529-4c02-80df-e21ae676783b :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 7ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"1854ec8a-7778-4ed5-91bb-91da3bb767c8", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 1854ec8a-7778-4ed5-91bb-91da3bb767c8 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:22:14.832997"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:22:14.831346"], ["state", "pending"], ["updated_at", "2014-10-21 22:22:14.832997"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:23:54.033130"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:23:54.033130"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6aec31a7-292e-4acf-b594-062b459aefcd", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6aec31a7-292e-4acf-b594-062b459aefcd :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:23:54.069985"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:23:54.060845"], ["state", "pending"], ["updated_at", "2014-10-21 22:23:54.069985"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 32ms (Views: 0.3ms | ActiveRecord: 3.6ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"d04fa864-bd9d-4858-840e-72f480a6beb2", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: d04fa864-bd9d-4858-840e-72f480a6beb2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:23:54.165188"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:23:54.163735"], ["state", "pending"], ["updated_at", "2014-10-21 22:23:54.165188"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"55189c3d-02af-4eda-ba05-e2539d33b119", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 55189c3d-02af-4eda-ba05-e2539d33b119 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:23:54.175817"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:23:54.174454"], ["state", "pending"], ["updated_at", "2014-10-21 22:23:54.175817"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.3ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"1015985f-b949-4449-b833-d0e687d8bc13", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 1015985f-b949-4449-b833-d0e687d8bc13 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:23:54.190048"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:23:54.188583"], ["state", "pending"], ["updated_at", "2014-10-21 22:23:54.190048"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"bbba22ad-38ef-42d4-a5ef-f5f499626839", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bbba22ad-38ef-42d4-a5ef-f5f499626839 :format: 1 ' LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 8ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"0921f2bb-2cb8-43e4-ad60-da5513e58b96", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0921f2bb-2cb8-43e4-ad60-da5513e58b96 :format: 1 ' LIMIT 1 SQL (0.7ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:24:55.064070"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:24:55.040578"], ["state", "pending"], ["updated_at", "2014-10-21 22:24:55.064070"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 22724ms (Views: 0.7ms | ActiveRecord: 2.1ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.5ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"65a70d3c-c834-4689-a6e8-4793f4e3c04d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 65a70d3c-c834-4689-a6e8-4793f4e3c04d :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:24:56.641863"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:24:56.635244"], ["state", "pending"], ["updated_at", "2014-10-21 22:24:56.641863"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 1548ms (Views: 0.6ms | ActiveRecord: 1.3ms)  (0.6ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.4ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"b2af2aef-5464-4e5e-8efd-b6727e2b0e3d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b2af2aef-5464-4e5e-8efd-b6727e2b0e3d :format: 1 ' LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 1074ms (Views: 0.6ms | ActiveRecord: 0.9ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.6ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:24:57.797333"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:24:57.797333"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"761c0579-d14e-4479-864a-6877a37a93c2", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 761c0579-d14e-4479-864a-6877a37a93c2 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:24:58.807858"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:24:58.801883"], ["state", "pending"], ["updated_at", "2014-10-21 22:24:58.807858"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 1005ms (Views: 0.6ms | ActiveRecord: 1.7ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"e835661c-350d-4e23-b819-e9f5a2b5e8a7", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e835661c-350d-4e23-b819-e9f5a2b5e8a7 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:25:01.718797"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:25:01.712532"], ["state", "pending"], ["updated_at", "2014-10-21 22:25:01.718797"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 2872ms (Views: 0.6ms | ActiveRecord: 1.7ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.4ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 12ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"11d59d11-c593-4c8b-8cb4-55407a1aa1be", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 11d59d11-c593-4c8b-8cb4-55407a1aa1be :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:25:22.140007"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:25:22.126505"], ["state", "pending"], ["updated_at", "2014-10-21 22:25:22.140007"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 27ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7aa9f5e2-676d-47e4-901f-33afc7c809af", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7aa9f5e2-676d-47e4-901f-33afc7c809af :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:25:22.163563"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:25:22.162152"], ["state", "pending"], ["updated_at", "2014-10-21 22:25:22.163563"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 14ms (Views: 0.2ms | ActiveRecord: 2.6ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"571dda71-0306-4cbc-b565-764e87f67a94", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 571dda71-0306-4cbc-b565-764e87f67a94 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 43ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:25:22.226917"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:25:22.226917"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"e0f33e22-14c4-410b-9c61-55dba3fe3a21", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e0f33e22-14c4-410b-9c61-55dba3fe3a21 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:25:22.233727"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:25:22.232391"], ["state", "pending"], ["updated_at", "2014-10-21 22:25:22.233727"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"e03d2202-02af-4506-869b-406bc070bd1d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e03d2202-02af-4506-869b-406bc070bd1d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:25:22.272396"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:25:22.270622"], ["state", "pending"], ["updated_at", "2014-10-21 22:25:22.272396"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8eeb7adb-6e36-4e69-b3f8-99fe44adf3f1", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8eeb7adb-6e36-4e69-b3f8-99fe44adf3f1 :format: 1 ' LIMIT 1 SQL (0.9ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:25:27.547578"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:25:27.534241"], ["state", "pending"], ["updated_at", "2014-10-21 22:25:27.547578"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 38ms (Views: 0.3ms | ActiveRecord: 4.1ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:25:27.569890"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:25:27.569890"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4cb01d85-af61-4d9e-a0a5-461e17c7bf86", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (37.7ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4cb01d85-af61-4d9e-a0a5-461e17c7bf86 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:25:27.618696"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:25:27.576828"], ["state", "pending"], ["updated_at", "2014-10-21 22:25:27.618696"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 47ms (Views: 0.2ms | ActiveRecord: 38.8ms) Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.6ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"2c2c875b-b73c-4058-81a6-db1c3f5c2f04", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2c2c875b-b73c-4058-81a6-db1c3f5c2f04 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:22.956546"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:22.949767"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:22.956546"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 22ms (Views: 0.7ms | ActiveRecord: 1.3ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"8fd8545d-7a2c-4185-9b25-512f8481af75", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8fd8545d-7a2c-4185-9b25-512f8481af75 :format: 1 ' LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 49ms (Views: 0.7ms | ActiveRecord: 0.9ms)  (0.8ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"a4fe1e83-3896-4f96-b6b5-2937f2996606", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a4fe1e83-3896-4f96-b6b5-2937f2996606 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:23.126170"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:23.119383"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:23.126170"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 68ms (Views: 0.7ms | ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6525a332-6576-48fc-8edf-ff1c08afbd44", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6525a332-6576-48fc-8edf-ff1c08afbd44 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:26.336028"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:26.321879"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:26.336028"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 31ms (Views: 0.5ms | ActiveRecord: 1.4ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"f04c5cf6-2006-4be9-8987-53b85e08571e", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f04c5cf6-2006-4be9-8987-53b85e08571e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:26.351095"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:26.349380"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:26.351095"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"f45bd918-2519-4965-ac85-f5544a74890f", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f45bd918-2519-4965-ac85-f5544a74890f :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 43ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"65623f2c-58f3-46f6-a660-80ceeaecf8d8", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.6ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.3ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 65623f2c-58f3-46f6-a660-80ceeaecf8d8 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:26.424276"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:26.422061"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:26.424276"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 17ms (Views: 0.3ms | ActiveRecord: 3.2ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:26.436393"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:26.436393"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7eb3bc59-8a45-4777-9995-9de5ccebeac7", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7eb3bc59-8a45-4777-9995-9de5ccebeac7 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:26.444217"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:26.442754"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:26.444217"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.8ms) ROLLBACK  (0.4ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 17ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"28f56bcb-22c0-4fd5-9603-a557531140d6", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 28f56bcb-22c0-4fd5-9603-a557531140d6 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 66ms (Views: 0.3ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"dcf69339-98f0-4132-aebe-17549b9bfb76", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: dcf69339-98f0-4132-aebe-17549b9bfb76 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:37.628556"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:37.627125"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:37.628556"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"74dc11d6-c7ac-4d53-bdf9-0f55925743a2", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 74dc11d6-c7ac-4d53-bdf9-0f55925743a2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:37.649668"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:37.648275"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:37.649668"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 14ms (Views: 0.2ms | ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:37.661256"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:37.661256"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"49d2beae-acad-4186-bb44-758d23704da0", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 49d2beae-acad-4186-bb44-758d23704da0 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:37.672274"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:37.670580"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:37.672274"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 8ms (Views: 0.2ms | ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"1b235ca9-9859-454b-999b-b880ac5c4cdb", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 1b235ca9-9859-454b-999b-b880ac5c4cdb :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:37.684557"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:37.683208"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:37.684557"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.8ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:27:43.475391"], ["pending_at", "2014-10-21 22:27:43.474994"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.475391"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:27:43.478108"], ["pending_at", "2014-10-21 22:27:43.477744"], ["state", "imported"], ["updated_at", "2014-10-21 22:27:43.478108"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:43.499327"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:43.499327"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.512550"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:43.503266"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.512550"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.516685"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:43.514835"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.516685"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.519823"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:43.518281"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.519823"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8799f80f-08b7-41ac-a701-46a35c6c7a9d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8799f80f-08b7-41ac-a701-46a35c6c7a9d :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.540657"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.538923"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.540657"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.4ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:43.558371"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:43.558371"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"387436e3-3f49-48b5-b7a0-4184a2c4f08d", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"2"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 2 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 387436e3-3f49-48b5-b7a0-4184a2c4f08d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.566820"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:43.565399"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.566820"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"d65b4c2e-4eb2-41df-98da-e7c2b7173852", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: d65b4c2e-4eb2-41df-98da-e7c2b7173852 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.584777"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.582262"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.584777"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.3ms | ActiveRecord: 1.4ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:27:43.600571"], ["pending_at", "2014-10-21 22:27:43.600205"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.600571"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_anonymous ------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"f32e6e16-a3dd-424c-8f14-798754d8a00d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f32e6e16-a3dd-424c-8f14-798754d8a00d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.612509"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.611125"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.612509"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:43.619680"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:43.619680"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.622880"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:43.621114"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.622880"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.626846"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:43.625095"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.626846"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.629743"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:27:43.628338"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.629743"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"2951b88e-7ff6-42e3-bfab-57ff80bef873", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 2951b88e-7ff6-42e3-bfab-57ff80bef873 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.4ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:43.652796"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:43.652796"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.656419"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.654860"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.656419"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.659592"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.657948"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.659592"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.662833"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.661358"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.662833"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('4db3f5b9-1732-4d52-99c7-803e85386a64', '4db3f5b9-1732-4d52-99c7-803e85386a64') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:43.668853"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:43.668853"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.671776"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.670277"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.671776"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.675149"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.673344"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.675149"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4db3f5b9-1732-4d52-99c7-803e85386a64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:27:43.678064"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:27:43.676717"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.678064"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" = '4db3f5b9-1732-4d52-99c7-803e85386a64' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:27:43.684268"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:27:43.684268"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:27:43.701769"], ["pending_at", "2014-10-21 22:27:43.701280"], ["state", "pending"], ["updated_at", "2014-10-21 22:27:43.701769"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:27:43.703974"], ["pending_at", "2014-10-21 22:27:43.703591"], ["state", "imported"], ["updated_at", "2014-10-21 22:27:43.703974"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.8ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:28:59.850233"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:28:59.850233"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.856420"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.853895"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.856420"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.860100"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.858637"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.860100"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.862721"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.861393"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.862721"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('01378099-5cab-45e6-baa2-b190389433d5', '01378099-5cab-45e6-baa2-b190389433d5') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:28:59.884326"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:28:59.884326"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"29265317-8506-4a2c-81d6-5b86862af22a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 29265317-8506-4a2c-81d6-5b86862af22a :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:28:59.905610"], ["pending_at", "2014-10-21 22:28:59.905124"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.905610"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"56165aaa-87fc-4365-aa56-b28e6d468ba5", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56165aaa-87fc-4365-aa56-b28e6d468ba5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.923640"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.922248"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.923640"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:28:59.932685"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:28:59.932685"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.936778"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.934739"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.936778"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.939661"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.938275"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.939661"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.942288"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.941041"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.942288"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = '01378099-5cab-45e6-baa2-b190389433d5' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:28:59.953639"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:28:59.953639"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.960574"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:28:59.955134"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.960574"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.963740"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:28:59.962308"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.963740"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.966472"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:28:59.965117"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.966472"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"d0963c82-8b9b-4eb8-a665-6563fa538cae", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: d0963c82-8b9b-4eb8-a665-6563fa538cae :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.979208"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:28:59.977922"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.979208"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:28:59.984634"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:28:59.984634"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.988449"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:28:59.986650"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.988449"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.991295"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:28:59.989896"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.991295"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 01378099-5cab-45e6-baa2-b190389433d5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:28:59.994029"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:28:59.992638"], ["state", "pending"], ["updated_at", "2014-10-21 22:28:59.994029"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:29:00.003099"], ["pending_at", "2014-10-21 22:29:00.002501"], ["state", "pending"], ["updated_at", "2014-10-21 22:29:00.003099"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:29:00.005217"], ["pending_at", "2014-10-21 22:29:00.004837"], ["state", "imported"], ["updated_at", "2014-10-21 22:29:00.005217"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:29:00.015678"], ["pending_at", "2014-10-21 22:29:00.015307"], ["state", "pending"], ["updated_at", "2014-10-21 22:29:00.015678"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-21 22:29:00.018149"], ["pending_at", "2014-10-21 22:29:00.017577"], ["state", "imported"], ["updated_at", "2014-10-21 22:29:00.018149"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"569dcb80-32e7-4513-a48f-d3d3a7b3f98d", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 569dcb80-32e7-4513-a48f-d3d3a7b3f98d :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:29:00.039621"], ["filename", "cat.png"], ["pending_at", "2014-10-21 22:29:00.037627"], ["state", "pending"], ["updated_at", "2014-10-21 22:29:00.039621"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-21 22:29:00.053552"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-21 22:29:00.053552"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4a00e5c2-b387-4f63-81e8-819048183194", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"6"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 6 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4a00e5c2-b387-4f63-81e8-819048183194 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-21 22:29:00.062158"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-21 22:29:00.060129"], ["state", "pending"], ["updated_at", "2014-10-21 22:29:00.062158"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 1.4ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.3ms) ROLLBACK ActiveRecord::SchemaMigration Load (6.1ms) SELECT "schema_migrations".* FROM "schema_migrations"  (11.0ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (4.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (10.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (5.5ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"7304e5b7-a764-434b-9976-f28e39a429ce", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7304e5b7-a764-434b-9976-f28e39a429ce :format: 1 ' LIMIT 1  (10.9ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 48ms (Views: 0.5ms | ActiveRecord: 11.6ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.4ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 00:33:57.727827"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 00:33:57.727827"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.733061"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.731386"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.733061"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.737586"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.735289"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.737586"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.741906"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.740085"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.741906"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (17.2ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('bb84b563-2b5b-4789-8fe7-6915eb874619', 'bb84b563-2b5b-4789-8fe7-6915eb874619') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 00:33:57.792161"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 00:33:57.792161"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.795462"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.793823"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.795462"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.798370"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.796938"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.798370"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.801266"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.799874"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.801266"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (1.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = 'bb84b563-2b5b-4789-8fe7-6915eb874619' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 00:33:57.812886"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 00:33:57.812886"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"0cd72609-d826-44e0-8c1a-64d759c54fbc", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"3"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 3 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0cd72609-d826-44e0-8c1a-64d759c54fbc :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.822510"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-22 00:33:57.820623"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.822510"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"0b9f414e-3a01-4e75-bcdf-3bf1ef89087c", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0b9f414e-3a01-4e75-bcdf-3bf1ef89087c :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.834633"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.833120"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.834633"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 00:33:57.843578"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 00:33:57.843578"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.853765"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-22 00:33:57.845208"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.853765"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.857632"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-22 00:33:57.855893"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.857632"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.860739"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-22 00:33:57.859201"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.860739"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"50ad5093-0966-49b2-af6f-d186e347fac4", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 50ad5093-0966-49b2-af6f-d186e347fac4 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.871022"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.869128"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.871022"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"14a34648-467b-4f7f-adf7-c3fbd0604d92", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 14a34648-467b-4f7f-adf7-c3fbd0604d92 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.884962"], ["filename", "cat.png"], ["pending_at", "2014-10-22 00:33:57.883367"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.884962"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.1ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 00:33:57.892126"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 00:33:57.892126"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.895433"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-22 00:33:57.893686"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.895433"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.898531"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-22 00:33:57.897016"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.898531"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb84b563-2b5b-4789-8fe7-6915eb874619 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 00:33:57.901574"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-22 00:33:57.900047"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.901574"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 00:33:57.911034"], ["pending_at", "2014-10-22 00:33:57.910648"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.911034"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 00:33:57.925109"], ["pending_at", "2014-10-22 00:33:57.924709"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.925109"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 00:33:57.926846"], ["pending_at", "2014-10-22 00:33:57.926514"], ["state", "imported"], ["updated_at", "2014-10-22 00:33:57.926846"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 00:33:57.932236"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 00:33:57.932236"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 00:33:57.937066"], ["pending_at", "2014-10-22 00:33:57.936493"], ["state", "pending"], ["updated_at", "2014-10-22 00:33:57.937066"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 00:33:57.939585"], ["pending_at", "2014-10-22 00:33:57.939239"], ["state", "imported"], ["updated_at", "2014-10-22 00:33:57.939585"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (22.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:34:45.260389"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:34:45.260389"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (6.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.303583"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.286489"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.303583"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.313939"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.312144"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.313939"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.317065"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.315414"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.317065"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = 'a75a3160-369c-4e13-b676-e295e4db607d' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:34:45.330992"], ["pending_at", "2014-10-22 08:34:45.330621"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.330992"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:34:45.332945"], ["pending_at", "2014-10-22 08:34:45.332632"], ["state", "imported"], ["updated_at", "2014-10-22 08:34:45.332945"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:34:45.353458"], ["pending_at", "2014-10-22 08:34:45.353095"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.353458"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:34:45.355154"], ["pending_at", "2014-10-22 08:34:45.354824"], ["state", "imported"], ["updated_at", "2014-10-22 08:34:45.355154"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7c527deb-b94e-40df-ac66-688a3bc176cc", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7c527deb-b94e-40df-ac66-688a3bc176cc :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.378778"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.377067"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.378778"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.3ms | ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"ba77e9a8-ae57-413c-8ac6-70e8b2ab2452", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ba77e9a8-ae57-413c-8ac6-70e8b2ab2452 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"0c412462-ddd2-4221-8c4b-1979a867d949", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0c412462-ddd2-4221-8c4b-1979a867d949 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.411954"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.410226"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.411954"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:34:45.428268"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:34:45.428268"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.438479"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:34:45.429955"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.438479"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.442075"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:34:45.440474"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.442075"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.445274"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:34:45.443642"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.445274"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:34:45.449926"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:34:45.449926"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.452885"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.451364"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.452885"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.455698"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.454350"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.455698"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.458456"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.457122"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.458456"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('a75a3160-369c-4e13-b676-e295e4db607d', 'a75a3160-369c-4e13-b676-e295e4db607d') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:34:45.480209"], ["pending_at", "2014-10-22 08:34:45.479817"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.480209"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4fa2a0f7-bf37-4c61-ac8b-5af4f51d358e", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4fa2a0f7-bf37-4c61-ac8b-5af4f51d358e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.492742"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:34:45.491290"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.492742"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:34:45.503245"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:34:45.503245"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:34:45.508844"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:34:45.508844"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ac78f47f-5e35-4a4d-b512-c8e020468af5", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 5 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ac78f47f-5e35-4a4d-b512-c8e020468af5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.515903"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:34:45.514492"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.515903"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.0ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:34:45.528131"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:34:45.528131"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.532247"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:34:45.530183"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.532247"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.535910"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:34:45.534145"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.535910"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a75a3160-369c-4e13-b676-e295e4db607d :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:34:45.539127"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:34:45.537595"], ["state", "pending"], ["updated_at", "2014-10-22 08:34:45.539127"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:35:34.473257"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:35:34.473257"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.503724"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.492950"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.503724"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.508491"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.506632"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.508491"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.511555"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.510091"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.511555"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.8ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = '56b04bf0-6748-4835-bc1b-66e3a078515e' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"9be0f743-30d4-499a-bcf8-d1228259d225", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9be0f743-30d4-499a-bcf8-d1228259d225 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.531221"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.529134"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.531221"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.4ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:35:34.539564"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:35:34.539564"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.547113"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:35:34.541211"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.547113"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.550643"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:35:34.549056"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.550643"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.553694"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:35:34.552184"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.553694"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:35:34.558941"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:35:34.558941"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.562134"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:35:34.560438"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.562134"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.565198"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:35:34.563680"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.565198"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.569195"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:35:34.567269"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.569195"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:35:34.585289"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:35:34.585289"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.589737"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.587230"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.589737"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.593840"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.591856"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.593840"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 56b04bf0-6748-4835-bc1b-66e3a078515e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.597355"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.595824"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.597355"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('56b04bf0-6748-4835-bc1b-66e3a078515e', '56b04bf0-6748-4835-bc1b-66e3a078515e') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:35:34.603767"], ["pending_at", "2014-10-22 08:35:34.603371"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.603767"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:35:34.605819"], ["pending_at", "2014-10-22 08:35:34.605477"], ["state", "imported"], ["updated_at", "2014-10-22 08:35:34.605819"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"da9fcc83-3c65-4821-884a-a695f658ccfd", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: da9fcc83-3c65-4821-884a-a695f658ccfd :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.648113"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.646652"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.648113"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:35:34.656824"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:35:34.656824"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"bfce04e0-f1d8-4f32-a471-cb85af72efb2", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 5 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bfce04e0-f1d8-4f32-a471-cb85af72efb2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.663969"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:35:34.662427"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.663969"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.1ms)  (0.6ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"0631e9fa-9f80-4459-84bf-d2e8bd347fce", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0631e9fa-9f80-4459-84bf-d2e8bd347fce :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:35:34.685213"], ["pending_at", "2014-10-22 08:35:34.684685"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.685213"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:35:34.704831"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:35:34.704831"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"5ece5c8a-57ca-4b9d-ab01-7f4b46bc7431", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5ece5c8a-57ca-4b9d-ab01-7f4b46bc7431 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:35:34.722775"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:35:34.721276"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.722775"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:35:34.727748"], ["pending_at", "2014-10-22 08:35:34.727366"], ["state", "pending"], ["updated_at", "2014-10-22 08:35:34.727748"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:35:34.729402"], ["pending_at", "2014-10-22 08:35:34.729072"], ["state", "imported"], ["updated_at", "2014-10-22 08:35:34.729402"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:37:53.967611"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:37:53.967611"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:37:53.978450"], ["pending_at", "2014-10-22 08:37:53.978049"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:53.978450"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"f7bef29c-096d-4bb5-aa5f-53e294e3259b", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f7bef29c-096d-4bb5-aa5f-53e294e3259b :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.000895"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:53.999154"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.000895"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 10ms (Views: 0.4ms | ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:37:54.014755"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:37:54.014755"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"89df71e5-f63e-426f-aa51-d31e018da9bd", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"2"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 2 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 89df71e5-f63e-426f-aa51-d31e018da9bd :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.026475"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:37:54.024547"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.026475"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 10ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:37:54.038623"], ["pending_at", "2014-10-22 08:37:54.038251"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.038623"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:37:54.040244"], ["pending_at", "2014-10-22 08:37:54.039918"], ["state", "imported"], ["updated_at", "2014-10-22 08:37:54.040244"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"32f522c6-612d-401f-82af-87c275bdaca3", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 32f522c6-612d-401f-82af-87c275bdaca3 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.065724"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.064267"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.065724"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:37:54.078638"], ["pending_at", "2014-10-22 08:37:54.078240"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.078638"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-22 08:37:54.080336"], ["pending_at", "2014-10-22 08:37:54.080007"], ["state", "imported"], ["updated_at", "2014-10-22 08:37:54.080336"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"dd4bdac3-fab3-4bd6-9b16-5582db7b51ae", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: dd4bdac3-fab3-4bd6-9b16-5582db7b51ae :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.095669"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.094103"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.095669"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:37:54.100946"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:37:54.100946"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.104449"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:37:54.102736"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.104449"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.107743"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:37:54.106120"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.107743"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.110768"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:37:54.109270"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.110768"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:37:54.115823"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:37:54.115823"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.118971"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:37:54.117292"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.118971"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.121999"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:37:54.120509"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.121999"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.124966"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2014-10-22 08:37:54.123493"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.124966"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:37:54.129770"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:37:54.129770"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.132875"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.131288"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.132875"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.135689"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.134329"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.135689"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.138388"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.137081"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.138388"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('b270d565-eb39-405d-8100-a25041b60dad', 'b270d565-eb39-405d-8100-a25041b60dad') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-22 08:37:54.149949"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-22 08:37:54.149949"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.153089"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.151489"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.153089"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.155986"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.154549"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.155986"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b270d565-eb39-405d-8100-a25041b60dad :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-22 08:37:54.158703"], ["filename", "cat.png"], ["pending_at", "2014-10-22 08:37:54.157352"], ["state", "pending"], ["updated_at", "2014-10-22 08:37:54.158703"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 6 WHERE "s3_relay_uploads"."uuid" = 'b270d565-eb39-405d-8100-a25041b60dad' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"6e923f98-9ca7-4a49-b519-645ea9549c7a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6e923f98-9ca7-4a49-b519-645ea9549c7a :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (25.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (3.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (10.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"7cba4e3f-91fb-4323-806f-3890f80f8ade", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (8.0ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7cba4e3f-91fb-4323-806f-3890f80f8ade :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 46ms (Views: 0.3ms | ActiveRecord: 8.4ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"886441ec-7821-4469-b0dc-27364dfddf91", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 886441ec-7821-4469-b0dc-27364dfddf91 :format: 1 ' LIMIT 1 SQL (0.9ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.827388"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.825886"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.827388"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-29 08:20:15.856415"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-29 08:20:15.856415"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.879544"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-29 08:20:15.866645"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.879544"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.884107"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-29 08:20:15.882166"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.884107"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.887620"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2014-10-29 08:20:15.885881"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.887620"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-29 08:20:15.897742"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-29 08:20:15.897742"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.901234"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.899454"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.901234"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.904161"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.902753"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.904161"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.906960"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.905595"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.906960"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" = '9bb58493-8d0d-4187-80ea-e5910ee0eb54' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ec6b9202-c928-4f03-932b-a0e907ac09e4", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ec6b9202-c928-4f03-932b-a0e907ac09e4 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.924093"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.922669"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.924093"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-29 08:20:15.935120"], ["pending_at", "2014-10-29 08:20:15.934747"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.935120"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-29 08:20:15.936963"], ["pending_at", "2014-10-29 08:20:15.936622"], ["state", "imported"], ["updated_at", "2014-10-29 08:20:15.936963"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-29 08:20:15.941654"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-29 08:20:15.941654"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.944891"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-29 08:20:15.943152"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.944891"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.948819"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-29 08:20:15.946579"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.948819"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.952274"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2014-10-29 08:20:15.950601"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.952274"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-29 08:20:15.963557"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-29 08:20:15.963557"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.966551"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.964996"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.966551"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.969599"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.968018"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.969599"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9bb58493-8d0d-4187-80ea-e5910ee0eb54 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.972445"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:15.971051"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.972445"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('9bb58493-8d0d-4187-80ea-e5910ee0eb54', '9bb58493-8d0d-4187-80ea-e5910ee0eb54') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-29 08:20:15.981263"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-29 08:20:15.981263"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6f1fccfa-93ed-43f3-a5e5-9068605a8e91", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 5 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6f1fccfa-93ed-43f3-a5e5-9068605a8e91 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:15.989163"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2014-10-29 08:20:15.987639"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:15.989163"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.1ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2014-10-29 08:20:16.003449"], ["name", "Flux Capacitor"], ["updated_at", "2014-10-29 08:20:16.003449"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-29 08:20:16.011000"], ["pending_at", "2014-10-29 08:20:16.010626"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:16.011000"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-29 08:20:16.012668"], ["pending_at", "2014-10-29 08:20:16.012339"], ["state", "imported"], ["updated_at", "2014-10-29 08:20:16.012668"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-10-29 08:20:16.027306"], ["pending_at", "2014-10-29 08:20:16.026924"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:16.027306"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ecaf489b-a88d-4cac-bd0e-e881ba303e09", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ecaf489b-a88d-4cac-bd0e-e881ba303e09 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2014-10-29 08:20:16.040183"], ["filename", "cat.png"], ["pending_at", "2014-10-29 08:20:16.038814"], ["state", "pending"], ["updated_at", "2014-10-29 08:20:16.040183"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.0ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (25.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (10.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (11.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (12.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (1.0ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:34.699713"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:34.699713"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"bed9ef83-ee45-4e59-81b9-9ddbaa8f04cf", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"1"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 1 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (11.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bed9ef83-ee45-4e59-81b9-9ddbaa8f04cf :format: 1 ' LIMIT 1 SQL (6.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.759319"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.735496"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.759319"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 46ms (Views: 0.4ms | ActiveRecord: 19.0ms)  (0.8ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"38ca06be-ac93-4fd3-970b-b8e3eb1c061b", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 38ca06be-ac93-4fd3-970b-b8e3eb1c061b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.786105"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.784424"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.786105"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:34.808283"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:34.808283"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.811910"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.810154"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.811910"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.814828"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.813526"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.814828"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.817464"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.816182"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.817464"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('9b6468fc-75ca-4303-b5fa-450e700931d6', '9b6468fc-75ca-4303-b5fa-450e700931d6') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 01:51:34.824646"], ["pending_at", "2015-02-02 01:51:34.824309"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.824646"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 01:51:34.826378"], ["pending_at", "2015-02-02 01:51:34.826114"], ["state", "imported"], ["updated_at", "2015-02-02 01:51:34.826378"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8e305e9a-297d-46df-b689-d690ac681cc3", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8e305e9a-297d-46df-b689-d690ac681cc3 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.836708"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.835320"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.836708"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.3ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"e6c916c4-f262-4249-900a-8cab89447ca8", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e6c916c4-f262-4249-900a-8cab89447ca8 :format: 1 ' LIMIT 1  (1.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 4ms (Views: 0.3ms | ActiveRecord: 1.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:34.876840"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:34.876840"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:34.897016"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:34.897016"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.901083"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.899009"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.901083"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.904765"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.902931"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.904765"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.908149"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.906541"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.908149"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:34.914774"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:34.914774"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.918837"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.913501"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.918837"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"c9c20e82-ad07-44c5-bd37-2ee38fb1fbe1", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c9c20e82-ad07-44c5-bd37-2ee38fb1fbe1 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.937778"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.936440"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.937778"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.3ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 01:51:34.946601"], ["pending_at", "2015-02-02 01:51:34.946292"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.946601"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 01:51:34.948214"], ["pending_at", "2015-02-02 01:51:34.947888"], ["state", "imported"], ["updated_at", "2015-02-02 01:51:34.948214"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 01:51:34.962240"], ["pending_at", "2015-02-02 01:51:34.961891"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.962240"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:34.977508"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:34.977508"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.980412"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.978941"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.980412"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.983032"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.981763"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.983032"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.985604"], ["filename", "cat.png"], ["pending_at", "2015-02-02 01:51:34.984345"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.985604"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 6 WHERE "s3_relay_uploads"."uuid" = '9b6468fc-75ca-4303-b5fa-450e700931d6' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:34.992139"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:34.992139"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.995041"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.993498"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.995041"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:34.997922"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.996550"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:34.997922"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9b6468fc-75ca-4303-b5fa-450e700931d6 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 01:51:35.000764"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 01:51:34.999373"], ["state", "pending"], ["updated_at", "2015-02-02 01:51:35.000764"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.1ms) BEGIN ------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field: test_0001_anonymous ------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:51:50.399776"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:51:50.399776"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:53:04.684421"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:53:04.684421"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:53:04.695513"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:53:04.695513"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:53:17.849924"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:53:17.849924"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:53:17.860767"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:53:17.860767"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:53:41.946388"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:53:41.946388"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:53:41.971984"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:53:41.971984"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:53:41.980245"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:53:41.980245"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:54:01.929513"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:54:01.929513"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:54:01.954009"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:54:01.954009"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:54:01.965118"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:54:01.965118"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:54:24.336458"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:54:24.336458"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:54:24.347281"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:54:24.347281"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:54:24.368449"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:54:24.368449"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:03.624287"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:03.624287"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:03.650723"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:03.650723"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:03.657492"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:03.657492"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:15.331500"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:15.331500"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:15.344071"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:15.344071"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:15.353398"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:15.353398"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:29.552149"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:29.552149"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:29.579887"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:29.579887"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:29.585902"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:29.585902"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:42.713710"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:42.713710"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:42.738236"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:42.738236"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:42.744655"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:42.744655"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:58.609828"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:58.609828"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:58.623089"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:58.623089"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:55:58.643295"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:55:58.643295"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.0ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (7.2ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:56:15.165350"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:56:15.165350"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:56:15.188262"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:56:15.188262"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:56:15.195493"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:56:15.195493"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:57:03.352683"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:57:03.352683"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:57:03.362716"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:57:03.362716"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:57:03.368594"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:57:03.368594"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.5ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.6ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:58:36.258426"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:58:36.258426"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:58:36.273168"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:58:36.273168"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:58:36.290913"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:58:36.290913"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (6.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:58:57.276521"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:58:57.276521"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:58:57.284389"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:58:57.284389"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 01:58:57.291934"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 01:58:57.291934"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (1.0ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.6ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (15.1ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"14abbf46-af79-4ccd-bffe-36b014c9be98", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 14abbf46-af79-4ccd-bffe-36b014c9be98 :format: 1 ' LIMIT 1 SQL (6.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.290483"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.265078"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.290483"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 52ms (Views: 0.3ms | ActiveRecord: 7.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.326936"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.326936"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.339032"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.313065"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.339032"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:10:28.345090"], ["pending_at", "2015-02-02 02:10:28.344607"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.345090"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:10:28.347272"], ["pending_at", "2015-02-02 02:10:28.346941"], ["state", "imported"], ["updated_at", "2015-02-02 02:10:28.347272"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6640f939-52ef-4445-8732-0eebf607fce2", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6640f939-52ef-4445-8732-0eebf607fce2 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.366101"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.364505"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.366101"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.4ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.377215"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.377215"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"7bf35dbe-3af3-4aec-af3f-dac88e2fdea6", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"2"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 2 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 7bf35dbe-3af3-4aec-af3f-dac88e2fdea6 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.386020"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.384286"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.386020"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.393212"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.393212"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"23e8e03f-610b-45f1-9987-13c05dcb2060", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 23e8e03f-610b-45f1-9987-13c05dcb2060 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.423342"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.423342"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:10:28.429269"], ["pending_at", "2015-02-02 02:10:28.428786"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.429269"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:10:28.431647"], ["pending_at", "2015-02-02 02:10:28.431228"], ["state", "imported"], ["updated_at", "2015-02-02 02:10:28.431647"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.442242"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.442242"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.446282"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.444338"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.446282"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.449882"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.448218"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.449882"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.453086"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.451542"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.453086"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.459413"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.459413"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:10:28.467682"], ["pending_at", "2015-02-02 02:10:28.467285"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.467682"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"a287eca2-8643-4ad3-8745-40a3c7f85a26", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a287eca2-8643-4ad3-8745-40a3c7f85a26 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.487250"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.484467"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.487250"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 8ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.495983"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.495983"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.499523"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.497803"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.499523"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.502825"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.501283"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.502825"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.506621"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.504707"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.506621"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 7 WHERE "s3_relay_uploads"."uuid" = 'e3c289ef-2f7d-415f-88e0-280f433d182b' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.514096"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.514096"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.517138"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.515580"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.517138"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.520115"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.518712"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.520115"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.522922"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:10:28.521582"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.522922"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 8 WHERE "s3_relay_uploads"."uuid" IN ('e3c289ef-2f7d-415f-88e0-280f433d182b', 'e3c289ef-2f7d-415f-88e0-280f433d182b') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:10:28.553422"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:10:28.553422"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.556857"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.555021"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.556857"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.560971"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.558777"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.560971"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e3c289ef-2f7d-415f-88e0-280f433d182b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:10:28.564339"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:10:28.562724"], ["state", "pending"], ["updated_at", "2015-02-02 02:10:28.564339"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (24.3ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.742047"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.742047"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:11:28.769739"], ["pending_at", "2015-02-02 02:11:28.769186"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.769739"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:11:28.778659"], ["pending_at", "2015-02-02 02:11:28.778287"], ["state", "imported"], ["updated_at", "2015-02-02 02:11:28.778659"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.791545"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.791545"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"ec1a9c67-ada2-4a95-829a-602fab211a0a", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"2"} Product Load (0.7ms) SELECT "products".* FROM "products" WHERE "products"."id" = 2 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: ec1a9c67-ada2-4a95-829a-602fab211a0a :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.817195"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.802296"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.817195"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 22ms (Views: 0.3ms | ActiveRecord: 1.8ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.827295"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.827295"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"60b05fc7-2a21-4f34-812e-25771af20ed0", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 60b05fc7-2a21-4f34-812e-25771af20ed0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.841085"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:28.839471"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.841085"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.847905"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.847905"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.851151"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.847149"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.851151"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:11:28.857852"], ["pending_at", "2015-02-02 02:11:28.857442"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.857852"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:11:28.859637"], ["pending_at", "2015-02-02 02:11:28.859286"], ["state", "imported"], ["updated_at", "2015-02-02 02:11:28.859637"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.869239"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.869239"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.873709"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.873709"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.877053"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:28.875420"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.877053"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.880155"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:28.878759"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.880155"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.883084"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:28.881646"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.883084"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 6 WHERE "s3_relay_uploads"."uuid" = '41528218-1a35-4ae7-84a9-a5e41fb70c64' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"f5c10519-819e-48f0-8fd0-b55ef93c2d5a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f5c10519-819e-48f0-8fd0-b55ef93c2d5a :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 12ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"6c204439-38bb-4516-83b8-f335077f8794", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6c204439-38bb-4516-83b8-f335077f8794 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.928582"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:28.927113"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.928582"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.941668"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.941668"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.944974"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.943228"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.944974"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.948476"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.946644"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.948476"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.951968"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.950313"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.951968"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"28e13de6-6172-44b7-95e4-a5a5361e5748", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 28e13de6-6172-44b7-95e4-a5a5361e5748 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.967883"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:28.966353"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.967883"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.4ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:28.981504"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:28.981504"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.985191"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.983221"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.985191"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.988824"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.987073"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.988824"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:28.991965"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:11:28.990413"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:28.991965"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:11:29.016241"], ["pending_at", "2015-02-02 02:11:29.015772"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:29.016241"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:11:29.025666"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:11:29.025666"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:29.028702"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:29.027166"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:29.028702"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:29.031592"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:29.030206"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:29.031592"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 41528218-1a35-4ae7-84a9-a5e41fb70c64 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:11:29.034421"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:11:29.033021"], ["state", "pending"], ["updated_at", "2015-02-02 02:11:29.034421"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 9 WHERE "s3_relay_uploads"."uuid" IN ('41528218-1a35-4ae7-84a9-a5e41fb70c64', '41528218-1a35-4ae7-84a9-a5e41fb70c64') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (4.5ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.3ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.243011"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.243011"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.248318"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.246221"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.248318"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.257667"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.255384"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.257667"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.260917"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.259390"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.260917"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = '8c8c6c67-99fa-4a25-84b7-240b42377ed2' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.283511"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.283511"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"bb919dfa-88a4-4fd0-b5a7-06bc76e01e2a", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: bb919dfa-88a4-4fd0-b5a7-06bc76e01e2a :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.300456"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.298748"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.300456"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.3ms | ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"b23b3287-9a25-43db-a04f-5be6d6d4a29f", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b23b3287-9a25-43db-a04f-5be6d6d4a29f :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.318349"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.318349"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.322926"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.320639"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.322926"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.327525"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.325262"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.327525"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.330970"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.329367"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.330970"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('8c8c6c67-99fa-4a25-84b7-240b42377ed2', '8c8c6c67-99fa-4a25-84b7-240b42377ed2') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.339894"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.339894"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"79f52ee5-e442-4987-9892-02978f0c5404", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"4"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 4 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 79f52ee5-e442-4987-9892-02978f0c5404 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.348951"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.345856"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.348951"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 9ms (Views: 0.3ms | ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 3ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"88e71f4f-fc20-4925-a168-805377d99c8c", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 88e71f4f-fc20-4925-a168-805377d99c8c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.384281"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.382659"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.384281"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.391506"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.391506"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:08.395672"], ["pending_at", "2015-02-02 02:12:08.395263"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.395672"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:08.397598"], ["pending_at", "2015-02-02 02:12:08.397294"], ["state", "imported"], ["updated_at", "2015-02-02 02:12:08.397598"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.402723"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.402723"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.405856"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.401936"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.405856"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.420678"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.420678"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:08.428828"], ["pending_at", "2015-02-02 02:12:08.428410"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.428828"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.439745"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.439745"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.443705"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.441844"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.443705"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.447024"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.445422"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.447024"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.450248"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.448616"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.450248"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"9e688d51-c288-480c-ad19-71ea0d24697b", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 9e688d51-c288-480c-ad19-71ea0d24697b :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.463105"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:08.460511"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.463105"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.3ms | ActiveRecord: 1.4ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:08.477655"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:08.477655"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.481084"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.479254"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.481084"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.484357"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.482790"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.484357"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8c8c6c67-99fa-4a25-84b7-240b42377ed2 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:08.487545"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:08.485998"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.487545"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:08.492769"], ["pending_at", "2015-02-02 02:12:08.492396"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:08.492769"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:08.494545"], ["pending_at", "2015-02-02 02:12:08.494215"], ["state", "imported"], ["updated_at", "2015-02-02 02:12:08.494545"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.7ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (6.5ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:31.572287"], ["pending_at", "2015-02-02 02:12:31.571882"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.572287"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:31.589189"], ["pending_at", "2015-02-02 02:12:31.588661"], ["state", "imported"], ["updated_at", "2015-02-02 02:12:31.589189"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.606810"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.606810"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.611483"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.605805"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.611483"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"e19fd1bf-b291-4541-a925-87f7dc073155", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e19fd1bf-b291-4541-a925-87f7dc073155 :format: 1 ' LIMIT 1 SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.628636"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.626436"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.628636"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 8ms (Views: 0.4ms | ActiveRecord: 1.6ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:31.647433"], ["pending_at", "2015-02-02 02:12:31.646930"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.647433"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:31.670000"], ["pending_at", "2015-02-02 02:12:31.669645"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.670000"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:31.671823"], ["pending_at", "2015-02-02 02:12:31.671505"], ["state", "imported"], ["updated_at", "2015-02-02 02:12:31.671823"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.677627"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.677627"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.682248"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.682248"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.685927"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.685927"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.689419"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.687603"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.689419"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.692894"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.691306"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.692894"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.696047"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.694510"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.696047"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.701643"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.701643"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.704736"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.703124"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.704736"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.707704"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.706288"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.707704"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.710773"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.709194"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.710773"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" = '48b951ff-9ecd-4b90-893e-2ea9a52ec445' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"08adef19-1c02-46ab-a989-b8e38578416c", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 08adef19-1c02-46ab-a989-b8e38578416c :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.723150"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.721682"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.723150"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.4ms | ActiveRecord: 0.9ms)  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"f984177e-796c-4d35-b270-fff7b78f9e61", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f984177e-796c-4d35-b270-fff7b78f9e61 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.760130"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.760130"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.765266"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.762578"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.765266"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.768946"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.767483"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.768946"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.771925"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.770510"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.771925"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 6 WHERE "s3_relay_uploads"."uuid" IN ('48b951ff-9ecd-4b90-893e-2ea9a52ec445', '48b951ff-9ecd-4b90-893e-2ea9a52ec445') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"5d834246-7057-46ab-8fa7-fa28343be487", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5d834246-7057-46ab-8fa7-fa28343be487 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.783615"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:31.782091"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.783615"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.794654"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.794654"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"4ce5ab53-cff5-48fb-ba22-25217c5547a3", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"7"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 7 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 4ce5ab53-cff5-48fb-ba22-25217c5547a3 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.802839"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.801156"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.802839"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.813541"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.813541"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:31.818604"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:31.818604"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.821971"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.820120"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.821971"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.825198"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.823636"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.825198"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 48b951ff-9ecd-4b90-893e-2ea9a52ec445 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:31.828315"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:31.826776"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:31.828315"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (2.4ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.0ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.7ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"a4c0eb2f-4494-434d-8ee5-8cec378600f1", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: a4c0eb2f-4494-434d-8ee5-8cec378600f1 :format: 1 ' LIMIT 1 SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.561582"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.547748"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.561582"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 33ms (Views: 0.2ms | ActiveRecord: 1.4ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:49.595541"], ["pending_at", "2015-02-02 02:12:49.595155"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.595541"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.650473"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.650473"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.654880"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.653139"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.654880"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.658100"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.656634"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.658100"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.661563"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.659748"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.661563"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" = '0e383e6f-3f24-4b50-ab8a-27782b64ec34' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:49.675672"], ["pending_at", "2015-02-02 02:12:49.675051"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.675672"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:49.677960"], ["pending_at", "2015-02-02 02:12:49.677608"], ["state", "imported"], ["updated_at", "2015-02-02 02:12:49.677960"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.684697"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.684697"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.687894"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.686241"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.687894"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.690912"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.689470"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.690912"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.693950"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.692487"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.693950"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 2 WHERE "s3_relay_uploads"."uuid" IN ('0e383e6f-3f24-4b50-ab8a-27782b64ec34', '0e383e6f-3f24-4b50-ab8a-27782b64ec34') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 2 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.706483"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.706483"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.709802"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.708053"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.709802"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.713985"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.712199"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.713985"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.717226"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.715652"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.717226"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.723216"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.723216"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8da2d104-36c3-4080-8eed-3c4770b2d8cf", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8da2d104-36c3-4080-8eed-3c4770b2d8cf :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.736723"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.735160"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.736723"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.4ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.747733"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.747733"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.755053"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.755053"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"42a146d1-9a68-4571-9729-a223909a527f", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 42a146d1-9a68-4571-9729-a223909a527f :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.772314"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.772314"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.777459"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.770888"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.777459"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"5a701d8d-b9a3-4f81-913e-1c40629dfee5", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5a701d8d-b9a3-4f81-913e-1c40629dfee5 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.791398"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:12:49.788604"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.791398"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.798979"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.798979"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"71ea8731-f1cc-4605-94b5-cf595e750b46", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"8"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 8 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 71ea8731-f1cc-4605-94b5-cf595e750b46 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.805796"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.804316"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.805796"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:12:49.813768"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:12:49.813768"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.818671"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.816172"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.818671"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.822654"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.820893"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.822654"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 0e383e6f-3f24-4b50-ab8a-27782b64ec34 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:12:49.826914"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:12:49.824540"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.826914"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:49.831932"], ["pending_at", "2015-02-02 02:12:49.831579"], ["state", "pending"], ["updated_at", "2015-02-02 02:12:49.831932"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:12:49.833625"], ["pending_at", "2015-02-02 02:12:49.833274"], ["state", "imported"], ["updated_at", "2015-02-02 02:12:49.833625"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (5.9ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.205341"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.205341"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.8ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.237680"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.222362"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.237680"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.243445"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.241394"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.243445"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.247103"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.245309"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.247103"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.8ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"3adfe849-bf52-45d3-9070-fc0bf57824b5", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 3adfe849-bf52-45d3-9070-fc0bf57824b5 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.266951"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.265276"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.266951"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.5ms | ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.279253"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.279253"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.282770"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.278078"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.282770"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"8e5b2a64-79d5-4f89-b805-2e9a2606d372", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 8e5b2a64-79d5-4f89-b805-2e9a2606d372 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.294063"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.292648"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.294063"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.2ms)  (0.5ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.303240"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.303240"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"b6acb7cc-1160-4c16-9cc5-58fca14e6b2f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"3"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 3 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b6acb7cc-1160-4c16-9cc5-58fca14e6b2f :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.310462"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.308958"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.310462"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.323545"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.323545"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"914b987a-f1a0-471f-8294-911fd03cb744", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 914b987a-f1a0-471f-8294-911fd03cb744 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.334569"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.332616"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.334569"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.342395"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.342395"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.383016"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.383016"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:03.412769"], ["pending_at", "2015-02-02 02:13:03.412224"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.412769"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:03.415683"], ["pending_at", "2015-02-02 02:13:03.415179"], ["state", "imported"], ["updated_at", "2015-02-02 02:13:03.415683"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.4ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:03.421094"], ["pending_at", "2015-02-02 02:13:03.420691"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.421094"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:03.423004"], ["pending_at", "2015-02-02 02:13:03.422588"], ["state", "imported"], ["updated_at", "2015-02-02 02:13:03.423004"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:03.431432"], ["pending_at", "2015-02-02 02:13:03.431059"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.431432"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.443555"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.443555"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.446761"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.445110"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.446761"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.450515"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.448451"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.450515"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.453862"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.452268"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.453862"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 7 WHERE "s3_relay_uploads"."uuid" IN ('6100d954-3a0c-4d26-9696-4c67bba78cc9', '6100d954-3a0c-4d26-9696-4c67bba78cc9') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.460261"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.460261"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.463259"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.461668"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.463259"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.466204"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.464788"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.466204"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.469064"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:03.467665"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.469064"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 8 WHERE "s3_relay_uploads"."uuid" = '6100d954-3a0c-4d26-9696-4c67bba78cc9' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"f1020c6e-4f0a-4b2b-8300-493402b91d14", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: f1020c6e-4f0a-4b2b-8300-493402b91d14 :format: 1 ' LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.6ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:03.485827"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:03.485827"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.489141"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.487397"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.489141"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.492436"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.490850"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.492436"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 6100d954-3a0c-4d26-9696-4c67bba78cc9 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:03.495540"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:03.494012"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:03.495540"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL  (1.8ms) select table_name from information_schema.views where table_schema = 's3_relay_test'  (8.4ms) TRUNCATE TABLE "s3_relay_uploads", "products" RESTART IDENTITY CASCADE;  (0.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL  (0.5ms) BEGIN  (0.2ms) COMMIT  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------- S3Relay::Upload::upon finalization: test_0001_anonymous -------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------- S3Relay::Upload::associations::parent: test_0001_anonymous ----------------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous ------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.099547"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.099547"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous ---------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.111273"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.111273"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.120038"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.120038"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (1.1ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.6ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.132588"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.122010"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.132588"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.144600"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.142531"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.144600"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.147918"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.146436"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.147918"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.7ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1 SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" = '5dd62b43-c0ca-44f0-9778-c769d4168902' AND "s3_relay_uploads"."upload_type" = 'IconUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous ---------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"55f30535-c811-4663-af9d-3294698fde9b", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 55f30535-c811-4663-af9d-3294698fde9b :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.166470"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.165119"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.166470"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------ S3Relay::Upload::validations::content_type: test_0001_validates presence ------------------------------------------------------------------------ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------- S3Relay::Upload::validations::pending_at: test_0001_validates presence ---------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous -----------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.193600"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.193600"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"e7ba682c-7023-46eb-88c3-dcab2630e6d0", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"4"} Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 4 LIMIT 1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: e7ba682c-7023-46eb-88c3-dcab2630e6d0 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.201509"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.199412"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.201509"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 4 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------- S3Relay::UploadsController::POST create::success: test_0001_anonymous ---------------------------------------------------------------------  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"c7814574-0096-4eb5-b6c8-9c674308d44e", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: c7814574-0096-4eb5-b6c8-9c674308d44e :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.212530"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.211106"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.212530"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------- S3Relay::Upload::validations::uuid: test_0001_validates presence ---------------------------------------------------------------- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness ------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:10.224084"], ["pending_at", "2015-02-02 02:13:10.223613"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.224084"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------- S3Relay::Upload::scopes::pending: test_0001_anonymous -----------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:10.232084"], ["pending_at", "2015-02-02 02:13:10.231689"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.232084"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:10.233723"], ["pending_at", "2015-02-02 02:13:10.233422"], ["state", "imported"], ["updated_at", "2015-02-02 02:13:10.233723"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#imported: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------------- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user --------------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"association"=>"photo_uploads", "uuid"=>"b2a24326-6c78-41ac-a535-8c7308a1ad58", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: b2a24326-6c78-41ac-a535-8c7308a1ad58 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.245008"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.243624"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.245008"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------------- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous -----------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.251784"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.251784"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.256506"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.256506"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.259301"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.257843"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.259301"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.261913"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.260670"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.261913"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.264863"], ["filename", "cat.png"], ["pending_at", "2015-02-02 02:13:10.263363"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.264863"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 6 WHERE "s3_relay_uploads"."uuid" IN ('5dd62b43-c0ca-44f0-9778-c769d4168902', '5dd62b43-c0ca-44f0-9778-c769d4168902') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload' S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- S3Relay::UploadsController::GET new: test_0001_anonymous -------------------------------------------------------- Processing by S3Relay::UploadsController#new as HTML Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------------------------------------- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous -----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.281242"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.281242"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.285441"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.279927"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.285441"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------- S3Relay::Upload::#pending?: test_0001_anonymous -----------------------------------------------  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.293750"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.293750"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.297071"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.295317"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.297071"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.300329"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.298754"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.300329"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.304291"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.302455"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.304291"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 8 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------- S3Relay::Upload::#private_url: test_0001_anonymous --------------------------------------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------ S3Relay::Upload::scopes::imported: test_0001_anonymous ------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:10.312258"], ["pending_at", "2015-02-02 02:13:10.311898"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.312258"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2015-02-02 02:13:10.313849"], ["pending_at", "2015-02-02 02:13:10.313560"], ["state", "imported"], ["updated_at", "2015-02-02 02:13:10.313849"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2015-02-02 02:13:10.320712"], ["name", "Flux Capacitor"], ["updated_at", "2015-02-02 02:13:10.320712"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.323840"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.322189"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.323840"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.326758"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.325348"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.326758"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 5dd62b43-c0ca-44f0-9778-c769d4168902 :format: 1 ' LIMIT 1 SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2015-02-02 02:13:10.329514"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2015-02-02 02:13:10.328156"], ["state", "pending"], ["updated_at", "2015-02-02 02:13:10.329514"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 9 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ----------------------------------------------------------------------- S3Relay::Upload::validations::upload_type: test_0001_validates presence ----------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- S3Relay::UploadsController::POST create::error: test_0001_anonymous -------------------------------------------------------------------  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" Processing by S3Relay::UploadsController#create as HTML Parameters: {"uuid"=>"61a6f38f-6201-4f4c-af91-69da91301580", "filename"=>"cat.png", "content_type"=>"image/png"}  (0.1ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '--- :value: 61a6f38f-6201-4f4c-af91-69da91301580 :format: 1 ' LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1 Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------- S3Relay::Upload::validations::filename: test_0001_validates presence -------------------------------------------------------------------- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN ----------------------------------------------------- S3Relay::Upload::#mark_imported!: test_0001_anonymous -----------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) COMMIT  (0.1ms) BEGIN  (0.1ms) ROLLBACK