s3_relay 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ba6dcf891cf6e43db75ed32808d80f9d6c8d458
4
- data.tar.gz: 64fc4391af9c1ac0d417a657b47f107fc52372ff
3
+ metadata.gz: f9fe731c3a3cdd23942a9286530e37957dcb8b7e
4
+ data.tar.gz: 634a0c6d096ab3ca4b903d05a86bbb4fdc4e76ec
5
5
  SHA512:
6
- metadata.gz: 872aecaa06f87e5e21a664b52b4381e50921309ed446de32716afdb7917fd075c6bcc2e03cee99fc862fe38c6deadbd2b2b74b0c1de1fd985e65e857fd60f9f5
7
- data.tar.gz: 50d5a817dd051f5344696e7c1f629520bef585f49e6cb917821cb184900380689e9e5c5ce2a493cfe683dd7bbb112d8cf8fd06c24c9c221b6749186e8e7a6817
6
+ metadata.gz: e1a74b83d9b770d597775871e3cb3defb0f3471c33f90cef4185e18892460f5cfbf9d1c306ac24de35efa0aed6dcb0f59e4bc677a550a1c11db06ee1587df127
7
+ data.tar.gz: 436ccc38e13a585e197f1b513b27b78378207b713be1b083b148d79d69e4263c54d1c2e226b25d34f20b18ca9194639d5adcf9d4113decba3e0a1678d42ebf0c
@@ -46,9 +46,13 @@ uploadFiles = (container) ->
46
46
  uploadFile = (container, file) ->
47
47
  fileName = file.name
48
48
 
49
+ # Assign unique id to each file to pass as get parameter so Safari doesn't
50
+ # consolidate the requests
51
+ $(file).uniqueId()
52
+
49
53
  $.ajax
50
54
  type: "GET"
51
- url: "/s3_relay/uploads/new"
55
+ url: "/s3_relay/uploads/new?unique_id=#{file.id}"
52
56
  success: (data, status, xhr) ->
53
57
  formData = new FormData()
54
58
  xhr = new XMLHttpRequest()
@@ -1,3 +1,3 @@
1
1
  module S3Relay
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -1,14 +1,26 @@
1
-  (1.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2
-  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1
+  (4.5ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
2
+  (3.0ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
3
+  (0.3ms) SELECT pg_try_advisory_lock(5724499521023098410);
4
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
5
  Migrating to CreateS3RelayUploads (20141009000804)
5
-  (0.1ms) BEGIN
6
-  (3.2ms) 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) 
7
- SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141009000804"]]
8
-  (0.5ms) COMMIT
6
+  (0.1ms) BEGIN
7
+ DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for:
8
+
9
+ class CreateS3RelayUploads < ActiveRecord::Migration[4.2] (called from block in execute at /Users/kjohnston/.rvm/gems/ruby-2.4.0@global/gems/rake-12.0.0/lib/rake/task.rb:250)
10
+  (3.9ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
11
+ SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20141009000804"]]
12
+  (0.5ms) COMMIT
9
13
  Migrating to CreateProducts (20141021002149)
10
-  (5.9ms) BEGIN
11
-  (7.5ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
12
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141021002149"]]
13
-  (6.2ms) COMMIT
14
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
14
+  (0.2ms) BEGIN
15
+ DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for:
16
+
17
+ class CreateProducts < ActiveRecord::Migration[4.2] (called from block in execute at /Users/kjohnston/.rvm/gems/ruby-2.4.0@global/gems/rake-12.0.0/lib/rake/task.rb:250)
18
+  (3.0ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "created_at" timestamp, "updated_at" timestamp)
19
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20141021002149"]]
20
+  (0.3ms) COMMIT
21
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
22
+  (0.1ms) BEGIN
23
+ SQL (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", 2016-12-30 06:31:08 UTC], ["updated_at", 2016-12-30 06:31:08 UTC]]
24
+  (0.4ms) COMMIT
25
+  (0.3ms) SELECT pg_advisory_unlock(5724499521023098410)
26
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -1,1078 +1,400 @@
1
- SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2
-  (24.0ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying(255), "created_at" timestamp, "updated_at" timestamp)
3
-  (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) 
4
-  (1.0ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
5
-  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6
-  (0.3ms) SELECT version FROM "schema_migrations"
7
-  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141021002149')
8
-  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20141009000804')
9
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
10
-  (0.4ms) ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL
11
-  (1.3ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
12
-  (3.9ms) TRUNCATE TABLE "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
13
-  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
14
-  (0.2ms) BEGIN
15
-  (0.1ms) COMMIT
16
-  (0.1ms) BEGIN
17
-  (0.1ms) ROLLBACK
18
-  (0.1ms) BEGIN
19
-  (0.1ms) COMMIT
20
-  (0.1ms) BEGIN
21
-  (0.1ms) SAVEPOINT active_record_1
22
- SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.191017"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.191017"]]
23
-  (0.1ms) RELEASE SAVEPOINT active_record_1
24
-  (0.1ms) SAVEPOINT active_record_1
25
- S3Relay::Upload Exists (0.7ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
26
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
27
- :format: 1
28
- ' LIMIT 1
29
- 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", "2016-04-14 17:07:11.211393"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.202062"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.211393"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
30
-  (0.2ms) RELEASE SAVEPOINT active_record_1
31
-  (0.1ms) SAVEPOINT active_record_1
32
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
33
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
34
- :format: 1
35
- ' LIMIT 1
36
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.220267"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.218692"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.220267"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
37
-  (0.1ms) RELEASE SAVEPOINT active_record_1
38
-  (0.1ms) SAVEPOINT active_record_1
39
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
40
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
41
- :format: 1
42
- ' LIMIT 1
43
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.222586"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.221492"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.222586"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
44
-  (0.1ms) RELEASE SAVEPOINT active_record_1
45
- 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'
46
- SQL (0.4ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('87bcb4f5-3358-414c-9b2b-8d39318e36b1', '87bcb4f5-3358-414c-9b2b-8d39318e36b1') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
47
- 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" = 'PhotoUpload'
48
-  (0.1ms) ROLLBACK
49
-  (0.1ms) BEGIN
50
- -----------------------------------------------------------------------------------
51
- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
52
- -----------------------------------------------------------------------------------
53
-  (0.1ms) SAVEPOINT active_record_1
54
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.231847"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.231847"]]
55
-  (0.1ms) RELEASE SAVEPOINT active_record_1
56
-  (0.1ms) SAVEPOINT active_record_1
57
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
58
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
59
- :format: 1
60
- ' LIMIT 1
61
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.234311"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.231295"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.234311"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
62
-  (0.1ms) RELEASE SAVEPOINT active_record_1
63
-  (0.1ms) ROLLBACK
64
-  (0.1ms) BEGIN
65
- ------------------------------------------------------------------------------------------
66
- S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
67
- ------------------------------------------------------------------------------------------
68
-  (0.1ms) SAVEPOINT active_record_1
69
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.238876"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.238876"]]
70
-  (0.1ms) RELEASE SAVEPOINT active_record_1
71
-  (0.1ms) ROLLBACK
72
-  (0.1ms) BEGIN
73
- ---------------------------------------------------------------------
74
- S3Relay::UploadsController::POST create::success: test_0001_anonymous
75
- ---------------------------------------------------------------------
76
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
77
- Processing by S3Relay::UploadsController#create as HTML
78
- Parameters: {"association"=>"photo_uploads", "uuid"=>"1ba7204c-fc7a-4b53-ac3e-85ff8253904c", "filename"=>"cat.png", "content_type"=>"image/png"}
79
-  (0.1ms) SAVEPOINT active_record_1
80
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
81
- :value: 1ba7204c-fc7a-4b53-ac3e-85ff8253904c
82
- :format: 1
83
- ' LIMIT 1
84
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.247579"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.246158"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.247579"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
85
-  (0.2ms) RELEASE SAVEPOINT active_record_1
86
- Completed 201 Created in 4ms (Views: 0.3ms | ActiveRecord: 0.7ms)
87
-  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
88
-  (0.1ms) ROLLBACK
89
-  (0.1ms) BEGIN
1
+  (201.5ms) DROP DATABASE IF EXISTS "s3_relay_test"
2
+  (396.9ms) CREATE DATABASE "s3_relay_test" ENCODING = 'unicode'
3
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
4
+  (5.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "created_at" timestamp, "updated_at" timestamp)
5
+  (3.4ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '{}', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
6
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
7
+  (0.4ms) SELECT version FROM "schema_migrations"
8
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141021002149')
9
+  (2.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
10
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
11
+  (0.1ms) BEGIN
12
+ SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2016-12-30 06:31:00 UTC], ["updated_at", 2016-12-30 06:31:00 UTC]]
13
+  (0.4ms) COMMIT
14
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
15
+  (0.1ms) BEGIN
16
+  (0.1ms) COMMIT
17
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
18
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
19
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
20
+  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
21
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
22
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
23
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
24
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
25
+  (173.2ms) DROP DATABASE IF EXISTS "s3_relay_test"
26
+  (397.9ms) CREATE DATABASE "s3_relay_test" ENCODING = 'unicode'
27
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
28
+  (4.8ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "created_at" timestamp, "updated_at" timestamp)
29
+  (3.3ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
30
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
31
+  (0.4ms) SELECT version FROM "schema_migrations"
32
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141021002149')
33
+  (2.5ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
34
+ ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
35
+  (0.1ms) BEGIN
36
+ SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", 2016-12-30 06:31:27 UTC], ["updated_at", 2016-12-30 06:31:27 UTC]]
37
+  (0.4ms) COMMIT
38
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
39
+  (0.1ms) BEGIN
40
+  (0.1ms) COMMIT
41
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
42
+  (0.2ms) SELECT pg_try_advisory_lock(5551432892130617310);
43
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
44
+ Migrating to CreateS3RelayUploads (20141009000804)
45
+  (0.1ms) BEGIN
46
+  (4.7ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
47
+  (0.1ms) ROLLBACK
48
+  (0.2ms) SELECT pg_advisory_unlock(5551432892130617310)
49
+  (0.2ms) SELECT pg_try_advisory_lock(5551432892130617310);
50
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
51
+ Migrating to CreateS3RelayUploads (20141009000804)
52
+  (0.1ms) BEGIN
53
+  (3.1ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
54
+  (0.1ms) ROLLBACK
55
+  (0.3ms) SELECT pg_advisory_unlock(5551432892130617310)
56
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
57
+  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
58
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
59
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
60
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
61
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", :environment]]
62
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
63
+  (4.1ms) DROP TABLE "products" CASCADE
64
+  (3.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "created_at" timestamp, "updated_at" timestamp)
65
+  (1.7ms) DROP TABLE "s3_relay_uploads" CASCADE
66
+  (3.2ms) CREATE TABLE "s3_relay_uploads" ("id" serial primary key, "uuid" bytea, "user_id" integer, "parent_type" character varying, "parent_id" integer, "upload_type" character varying, "filename" text, "content_type" character varying, "state" character varying, "data" json DEFAULT '"{}"', "pending_at" timestamp, "imported_at" timestamp, "created_at" timestamp, "updated_at" timestamp)
67
+  (0.4ms) SELECT version FROM "schema_migrations"
68
+  (0.7ms) INSERT INTO schema_migrations (version) VALUES
69
+ ('20141009000804');
70
+
71
+ 
72
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
73
+  (0.1ms) BEGIN
74
+  (0.4ms) COMMIT
75
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
76
+  (0.1ms) BEGIN
77
+  (0.1ms) COMMIT
78
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
79
+  (0.1ms) BEGIN
80
+  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
81
+  (0.1ms) COMMIT
82
+  (1.1ms)  SELECT schemaname || '.' || tablename
83
+ FROM pg_tables
84
+ WHERE
85
+ tablename !~ '_prt_' AND
86
+ tablename <> 'schema_migrations' AND
87
+ schemaname = ANY (current_schemas(false))
88
+ 
89
+  (0.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
90
+  (9.6ms) TRUNCATE TABLE "public"."ar_internal_metadata", "public"."products", "public"."s3_relay_uploads" RESTART IDENTITY CASCADE;
91
+  (0.3ms) BEGIN
92
+  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
93
+  (0.1ms) COMMIT
94
+  (0.2ms) BEGIN
95
+  (0.1ms) COMMIT
96
+  (0.1ms) BEGIN
97
+  (0.1ms) ROLLBACK
98
+  (0.1ms) BEGIN
99
+ -----------------------------------------------------
100
+ S3Relay::Upload::scopes::pending: test_0001_anonymous
101
+ -----------------------------------------------------
102
+  (0.2ms) SAVEPOINT active_record_1
103
+ SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "pending"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
104
+  (0.1ms) RELEASE SAVEPOINT active_record_1
105
+  (0.1ms) SAVEPOINT active_record_1
106
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "imported"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
107
+  (0.1ms) RELEASE SAVEPOINT active_record_1
108
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = $1 [["state", "pending"]]
109
+  (0.1ms) ROLLBACK
110
+  (0.1ms) BEGIN
111
+ -----------------------------------------------------------------------
112
+ S3Relay::Upload::validations::upload_type: test_0001_validates presence
113
+ -----------------------------------------------------------------------
114
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
115
+  (0.1ms) ROLLBACK
116
+  (0.1ms) BEGIN
117
+ ---------------------------------------------------------------------------------------------------------------------
118
+ S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
119
+ ---------------------------------------------------------------------------------------------------------------------
120
+  (0.1ms) ROLLBACK
121
+  (0.1ms) BEGIN
90
122
  --------------------------------------------------
91
123
  S3Relay::Upload::#private_url: test_0001_anonymous
92
124
  --------------------------------------------------
93
-  (0.1ms) ROLLBACK
94
-  (0.1ms) BEGIN
125
+  (0.1ms) ROLLBACK
126
+  (0.1ms) BEGIN
127
+ ------------------------------------------------------------------------
128
+ S3Relay::Upload::validations::content_type: test_0001_validates presence
129
+ ------------------------------------------------------------------------
130
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
131
+  (0.1ms) ROLLBACK
132
+  (0.1ms) BEGIN
133
+ ----------------------------------------------------------
134
+ S3Relay::Upload::associations::parent: test_0001_anonymous
135
+ ----------------------------------------------------------
136
+  (0.1ms) ROLLBACK
137
+  (0.1ms) BEGIN
138
+  (0.1ms) COMMIT
139
+  (0.1ms) BEGIN
140
+  (0.1ms) SAVEPOINT active_record_1
141
+ SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
142
+  (0.1ms) RELEASE SAVEPOINT active_record_1
143
+  (0.1ms) SAVEPOINT active_record_1
144
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
145
+  (0.1ms) ROLLBACK
146
+  (0.2ms) BEGIN
147
+ ---------------------------------------------------------------------------------
148
+ S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
149
+ ---------------------------------------------------------------------------------
150
+  (0.1ms) SAVEPOINT active_record_1
151
+ SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
152
+  (0.1ms) RELEASE SAVEPOINT active_record_1
153
+  (0.2ms) ROLLBACK
154
+  (0.1ms) BEGIN
155
+ ---------------------------------------------------------------------
156
+ S3Relay::UploadsController::POST create::success: test_0001_anonymous
157
+ ---------------------------------------------------------------------
158
+  (0.1ms) ROLLBACK
159
+  (0.1ms) BEGIN
160
+ -----------------------------------------------------------------------------------
161
+ S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
162
+ -----------------------------------------------------------------------------------
163
+  (0.1ms) SAVEPOINT active_record_1
164
+ SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
166
+  (0.1ms) ROLLBACK
167
+  (0.1ms) BEGIN
168
+ ----------------------------------------------------------------------
169
+ S3Relay::Upload::validations::pending_at: test_0001_validates presence
170
+ ----------------------------------------------------------------------
171
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
172
+  (0.1ms) ROLLBACK
173
+  (0.1ms) BEGIN
174
+  (0.1ms) COMMIT
175
+  (0.1ms) BEGIN
176
+  (0.1ms) ROLLBACK
177
+  (0.1ms) BEGIN
178
+  (0.1ms) COMMIT
179
+  (0.1ms) BEGIN
180
+  (0.1ms) ROLLBACK
181
+  (0.1ms) BEGIN
182
+  (0.1ms) COMMIT
183
+  (0.1ms) BEGIN
184
+  (0.1ms) ROLLBACK
185
+  (0.2ms) BEGIN
186
+  (0.1ms) COMMIT
187
+  (0.1ms) BEGIN
188
+  (0.1ms) SAVEPOINT active_record_1
189
+ SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
190
+  (0.1ms) RELEASE SAVEPOINT active_record_1
191
+  (0.1ms) SAVEPOINT active_record_1
192
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
193
+  (0.1ms) ROLLBACK
194
+  (0.2ms) BEGIN
95
195
  -----------------------------------------------
96
196
  S3Relay::Upload::#pending?: test_0001_anonymous
97
197
  -----------------------------------------------
98
-  (0.1ms) ROLLBACK
99
-  (0.1ms) BEGIN
100
- ---------------------------------------------------------------------------------------------------------------------
101
- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
102
- ---------------------------------------------------------------------------------------------------------------------
103
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
104
- Processing by S3Relay::UploadsController#create as HTML
105
- Parameters: {"association"=>"photo_uploads", "uuid"=>"4ecdbaa8-71fb-4201-8fb1-bd71edcaf96c", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
106
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
107
-  (0.1ms) SAVEPOINT active_record_1
108
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
109
- :value: 4ecdbaa8-71fb-4201-8fb1-bd71edcaf96c
110
- :format: 1
111
- ' LIMIT 1
112
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.260176"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.259087"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.260176"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
113
-  (0.1ms) RELEASE SAVEPOINT active_record_1
114
- Completed 201 Created in 3ms (Views: 0.1ms | ActiveRecord: 0.8ms)
115
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
116
-  (0.1ms) ROLLBACK
117
-  (0.1ms) BEGIN
198
+  (0.1ms) ROLLBACK
199
+  (0.2ms) BEGIN
200
+ -----------------------------------------------
201
+ S3Relay::Upload::#imported: test_0001_anonymous
202
+ -----------------------------------------------
203
+  (0.1ms) ROLLBACK
204
+  (0.1ms) BEGIN
205
+ -----------------------------------------------------------------------------
206
+ S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
207
+ -----------------------------------------------------------------------------
208
+  (0.1ms) SAVEPOINT active_record_1
209
+ SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
210
+  (0.1ms) RELEASE SAVEPOINT active_record_1
211
+  (0.3ms) ROLLBACK
212
+  (0.2ms) BEGIN
213
+ ------------------------------------------------------
214
+ S3Relay::Upload::scopes::imported: test_0001_anonymous
215
+ ------------------------------------------------------
216
+  (0.2ms) SAVEPOINT active_record_1
217
+ SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "pending"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
218
+  (0.1ms) RELEASE SAVEPOINT active_record_1
219
+  (0.1ms) SAVEPOINT active_record_1
220
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "imported"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
221
+  (0.1ms) RELEASE SAVEPOINT active_record_1
222
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = $1 [["state", "imported"]]
223
+  (0.1ms) ROLLBACK
224
+  (0.1ms) BEGIN
225
+  (0.1ms) COMMIT
226
+  (0.1ms) BEGIN
227
+  (0.1ms) ROLLBACK
228
+  (0.2ms) BEGIN
229
+ ------------------------------------------------------------------------------------------
230
+ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
231
+ ------------------------------------------------------------------------------------------
232
+  (0.1ms) SAVEPOINT active_record_1
233
+ SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
234
+  (0.1ms) RELEASE SAVEPOINT active_record_1
235
+  (0.2ms) ROLLBACK
236
+  (0.1ms) BEGIN
237
+ --------------------------------------------------------------------
238
+ S3Relay::Upload::validations::filename: test_0001_validates presence
239
+ --------------------------------------------------------------------
240
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
241
+  (0.1ms) ROLLBACK
242
+  (0.1ms) BEGIN
243
+ --------------------------------------------------------------------------------------------------------------------------------------------
244
+ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
245
+ --------------------------------------------------------------------------------------------------------------------------------------------
246
+  (0.1ms) ROLLBACK
247
+  (0.1ms) BEGIN
248
+ --------------------------------------------------------
249
+ S3Relay::UploadsController::GET new: test_0001_anonymous
250
+ --------------------------------------------------------
251
+  (0.1ms) ROLLBACK
252
+  (0.1ms) BEGIN
118
253
  -----------------------------------------------------
119
- S3Relay::Upload::scopes::pending: test_0001_anonymous
254
+ S3Relay::Upload::#mark_imported!: test_0001_anonymous
120
255
  -----------------------------------------------------
121
-  (0.1ms) SAVEPOINT active_record_1
122
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-04-14 17:07:11.264415"], ["pending_at", "2016-04-14 17:07:11.264161"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.264415"]]
123
-  (0.1ms) RELEASE SAVEPOINT active_record_1
124
-  (0.1ms) SAVEPOINT active_record_1
125
- SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-04-14 17:07:11.266297"], ["pending_at", "2016-04-14 17:07:11.265866"], ["state", "imported"], ["updated_at", "2016-04-14 17:07:11.266297"]]
126
-  (0.1ms) RELEASE SAVEPOINT active_record_1
127
- S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'
128
-  (0.1ms) ROLLBACK
256
+  (0.1ms) SAVEPOINT active_record_1
257
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
258
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
259
+  (0.1ms) ROLLBACK
260
+  (0.1ms) BEGIN
261
+ -------------------------------------------------------
262
+ S3Relay::Upload::upon finalization: test_0001_anonymous
263
+ -------------------------------------------------------
264
+  (0.1ms) ROLLBACK
265
+  (0.1ms) BEGIN
266
+ ----------------------------------------------------------------
267
+ S3Relay::Upload::validations::uuid: test_0001_validates presence
268
+ ----------------------------------------------------------------
269
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
270
+  (0.1ms) ROLLBACK
271
+  (0.1ms) BEGIN
272
+ ------------------------------------------------------------------
273
+ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
274
+ ------------------------------------------------------------------
275
+  (0.1ms) SAVEPOINT active_record_1
276
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["state", "pending"], ["pending_at", 2016-12-30 06:33:12 UTC], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
277
+  (0.3ms) RELEASE SAVEPOINT active_record_1
278
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
279
+  (0.1ms) ROLLBACK
280
+  (0.1ms) BEGIN
281
+  (0.0ms) COMMIT
282
+  (0.0ms) BEGIN
283
+  (0.1ms) SAVEPOINT active_record_1
284
+ SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", 2016-12-30 06:33:12 UTC], ["updated_at", 2016-12-30 06:33:12 UTC]]
285
+  (0.1ms) RELEASE SAVEPOINT active_record_1
286
+  (0.1ms) SAVEPOINT active_record_1
287
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
288
+  (0.1ms) ROLLBACK
289
+  (0.1ms) BEGIN
290
+ -------------------------------------------------------------------
291
+ S3Relay::UploadsController::POST create::error: test_0001_anonymous
292
+ -------------------------------------------------------------------
293
+  (0.1ms) ROLLBACK
294
+  (0.1ms) BEGIN
295
+ -----------------------------------------------------------------------------------------------------------------
296
+ S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
297
+ -----------------------------------------------------------------------------------------------------------------
298
+  (0.1ms) ROLLBACK
299
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
300
+  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
301
+  (1.0ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
302
+  (10.6ms) TRUNCATE TABLE "ar_internal_metadata", "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
303
+  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
129
304
   (0.1ms) BEGIN
130
305
   (0.1ms) COMMIT
131
306
   (0.1ms) BEGIN
132
307
   (0.1ms) SAVEPOINT active_record_1
133
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.271949"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.271949"]]
308
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.807336"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.807336"]]
134
309
   (0.1ms) RELEASE SAVEPOINT active_record_1
135
310
   (0.1ms) SAVEPOINT active_record_1
136
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
137
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
311
+ S3Relay::Upload Exists (2.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
312
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
138
313
  :format: 1
139
314
  ' LIMIT 1
140
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.274862"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.273150"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.274862"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
315
+ SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.831936"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.818698"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.831936"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
141
316
   (0.1ms) RELEASE SAVEPOINT active_record_1
142
317
   (0.1ms) SAVEPOINT active_record_1
143
318
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
144
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
319
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
145
320
  :format: 1
146
321
  ' LIMIT 1
147
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.277532"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.276429"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.277532"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
322
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.837536"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.834981"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.837536"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
148
323
   (0.1ms) RELEASE SAVEPOINT active_record_1
149
324
   (0.1ms) SAVEPOINT active_record_1
150
325
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
151
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
326
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
152
327
  :format: 1
153
328
  ' LIMIT 1
154
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.279566"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.278565"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.279566"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
329
+ SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.840710"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.839167"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.840710"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
155
330
   (0.1ms) RELEASE SAVEPOINT active_record_1
156
- 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
157
- SQL (0.2ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" = '87bcb4f5-3358-414c-9b2b-8d39318e36b1' AND "s3_relay_uploads"."upload_type" = 'IconUpload'
158
- 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" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1
331
+ S3Relay::Upload Load (0.9ms) 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
159
332
   (0.1ms) ROLLBACK
160
333
   (0.1ms) BEGIN
161
- ------------------------------------------------------
162
- S3Relay::Upload::scopes::imported: test_0001_anonymous
163
- ------------------------------------------------------
164
-  (0.1ms) SAVEPOINT active_record_1
165
- SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-04-14 17:07:11.284065"], ["pending_at", "2016-04-14 17:07:11.283793"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.284065"]]
166
-  (0.1ms) RELEASE SAVEPOINT active_record_1
167
-  (0.1ms) SAVEPOINT active_record_1
168
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-04-14 17:07:11.285393"], ["pending_at", "2016-04-14 17:07:11.285165"], ["state", "imported"], ["updated_at", "2016-04-14 17:07:11.285393"]]
169
-  (0.1ms) RELEASE SAVEPOINT active_record_1
170
- S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
171
-  (0.1ms) ROLLBACK
172
-  (0.1ms) BEGIN
173
- -------------------------------------------------------
174
- S3Relay::Upload::upon finalization: test_0001_anonymous
175
- -------------------------------------------------------
334
+ ----------------------------------------------------------------------
335
+ S3Relay::Upload::validations::pending_at: test_0001_validates presence
336
+ ----------------------------------------------------------------------
337
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
176
338
   (0.1ms) ROLLBACK
177
339
   (0.1ms) BEGIN
178
340
  -----------------------------------------------
179
- S3Relay::Upload::#imported: test_0001_anonymous
341
+ S3Relay::Upload::#pending?: test_0001_anonymous
180
342
  -----------------------------------------------
181
343
   (0.1ms) ROLLBACK
182
344
   (0.1ms) BEGIN
183
-  (0.1ms) COMMIT
184
-  (0.1ms) BEGIN
185
-  (0.1ms) ROLLBACK
186
-  (0.1ms) BEGIN
187
- --------------------------------------------------------
188
- S3Relay::UploadsController::GET new: test_0001_anonymous
189
- --------------------------------------------------------
190
- Processing by S3Relay::UploadsController#new as HTML
191
- Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
192
-  (0.1ms) ROLLBACK
193
-  (0.2ms) BEGIN
194
- -----------------------------------------------------------------------------------------------------------------
195
- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
196
- -----------------------------------------------------------------------------------------------------------------
345
+ ---------------------------------------------------------------------------------
346
+ S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
347
+ ---------------------------------------------------------------------------------
197
348
   (0.1ms) SAVEPOINT active_record_1
198
- SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.299020"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.299020"]]
199
-  (0.1ms) RELEASE SAVEPOINT active_record_1
200
-  (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'
201
- Processing by S3Relay::UploadsController#create as HTML
202
- Parameters: {"association"=>"photo_uploads", "uuid"=>"d67dbcab-939c-4773-b2c6-4adc53ca149c", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"}
203
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 5 LIMIT 1
204
-  (0.1ms) SAVEPOINT active_record_1
205
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
206
- :value: d67dbcab-939c-4773-b2c6-4adc53ca149c
207
- :format: 1
208
- ' LIMIT 1
209
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.305678"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.304312"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.305678"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
349
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.862657"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.862657"]]
210
350
   (0.1ms) RELEASE SAVEPOINT active_record_1
211
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.8ms)
212
-  (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'
213
-  (0.1ms) ROLLBACK
214
-  (0.1ms) BEGIN
215
- ------------------------------------------------------------------------
216
- S3Relay::Upload::validations::content_type: test_0001_validates presence
217
- ------------------------------------------------------------------------
218
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
219
-  (0.1ms) ROLLBACK
220
-  (0.1ms) BEGIN
221
- ----------------------------------------------------------
222
- S3Relay::Upload::associations::parent: test_0001_anonymous
223
- ----------------------------------------------------------
224
351
   (0.1ms) ROLLBACK
225
352
   (0.1ms) BEGIN
226
353
   (0.1ms) COMMIT
227
-  (0.0ms) BEGIN
354
+  (0.1ms) BEGIN
228
355
   (0.1ms) SAVEPOINT active_record_1
229
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.318534"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.318534"]]
356
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.866235"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.866235"]]
230
357
   (0.1ms) RELEASE SAVEPOINT active_record_1
231
358
   (0.1ms) SAVEPOINT active_record_1
232
359
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
233
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
360
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
234
361
  :format: 1
235
362
  ' LIMIT 1
236
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.321009"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.319654"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.321009"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
363
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.869235"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.867608"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.869235"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
237
364
   (0.1ms) RELEASE SAVEPOINT active_record_1
238
365
   (0.1ms) SAVEPOINT active_record_1
239
366
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
240
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
367
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
241
368
  :format: 1
242
369
  ' LIMIT 1
243
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.323240"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.322160"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.323240"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
370
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.872292"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.870845"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.872292"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
244
371
   (0.1ms) RELEASE SAVEPOINT active_record_1
245
372
   (0.1ms) SAVEPOINT active_record_1
246
373
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
247
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
374
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
248
375
  :format: 1
249
376
  ' LIMIT 1
250
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.325494"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.324400"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.325494"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
377
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.875168"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.873791"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.875168"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
251
378
   (0.1ms) RELEASE SAVEPOINT active_record_1
252
- 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" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1
379
+  (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'
253
380
   (0.1ms) ROLLBACK
254
381
   (0.1ms) BEGIN
255
- --------------------------------------------------------------------------------------------------------------------------------------------
256
- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
257
- --------------------------------------------------------------------------------------------------------------------------------------------
258
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
259
- Processing by S3Relay::UploadsController#create as HTML
260
- Parameters: {"association"=>"photo_uploads", "uuid"=>"f1d98adb-e282-4008-90b4-9e1ae6dd80e5", "filename"=>"cat.png", "content_type"=>"image/png"}
261
-  (0.1ms) SAVEPOINT active_record_1
262
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
263
- :value: f1d98adb-e282-4008-90b4-9e1ae6dd80e5
264
- :format: 1
265
- ' LIMIT 1
266
- 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", "2016-04-14 17:07:11.333409"], ["filename", "cat.png"], ["pending_at", "2016-04-14 17:07:11.332364"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.333409"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
267
-  (0.1ms) RELEASE SAVEPOINT active_record_1
268
- Completed 201 Created in 3ms (Views: 0.1ms | ActiveRecord: 0.6ms)
269
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
382
+  (0.1ms) COMMIT
383
+  (0.1ms) BEGIN
270
384
   (0.1ms) ROLLBACK
271
385
   (0.1ms) BEGIN
272
- -------------------------------------------------------------------
273
- S3Relay::UploadsController::POST create::error: test_0001_anonymous
274
- -------------------------------------------------------------------
275
-  (0.1ms) SELECT COUNT(*) FROM "s3_relay_uploads"
276
- Processing by S3Relay::UploadsController#create as HTML
277
- Parameters: {"uuid"=>"59afdf63-c475-414f-94fd-041b63cb1e30", "filename"=>"cat.png", "content_type"=>"image/png"}
278
-  (0.1ms) SAVEPOINT active_record_1
279
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
280
- :value: 59afdf63-c475-414f-94fd-041b63cb1e30
281
- :format: 1
282
- ' LIMIT 1
283
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
284
- Completed 422 Unprocessable Entity in 2ms (Views: 0.1ms | ActiveRecord: 0.4ms)
285
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
286
-  (0.1ms) ROLLBACK
287
-  (0.1ms) BEGIN
288
- ----------------------------------------------------------------------
289
- S3Relay::Upload::validations::pending_at: test_0001_validates presence
290
- ----------------------------------------------------------------------
291
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
386
+ --------------------------------------------------------
387
+ S3Relay::UploadsController::GET new: test_0001_anonymous
388
+ --------------------------------------------------------
389
+ Processing by S3Relay::UploadsController#new as HTML
390
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
292
391
   (0.1ms) ROLLBACK
293
392
   (0.1ms) BEGIN
294
- -----------------------------------------------------
295
- S3Relay::Upload::#mark_imported!: test_0001_anonymous
296
- -----------------------------------------------------
297
-  (0.1ms) SAVEPOINT active_record_1
298
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
299
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
300
-  (0.1ms) ROLLBACK
301
-  (0.1ms) BEGIN
302
-  (0.1ms) COMMIT
303
-  (0.1ms) BEGIN
304
-  (0.1ms) ROLLBACK
305
-  (0.1ms) BEGIN
306
-  (0.1ms) COMMIT
307
-  (0.1ms) BEGIN
308
-  (0.1ms) ROLLBACK
309
-  (0.1ms) BEGIN
310
-  (0.1ms) COMMIT
311
-  (0.0ms) BEGIN
312
-  (0.1ms) ROLLBACK
313
-  (0.1ms) BEGIN
314
393
  -----------------------------------------------------------------------------
315
394
  S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
316
395
  -----------------------------------------------------------------------------
317
-  (0.1ms) SAVEPOINT active_record_1
318
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.356277"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.356277"]]
319
-  (0.1ms) RELEASE SAVEPOINT active_record_1
320
-  (0.1ms) ROLLBACK
321
-  (0.1ms) BEGIN
322
- ----------------------------------------------------------------
323
- S3Relay::Upload::validations::uuid: test_0001_validates presence
324
- ----------------------------------------------------------------
325
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
326
-  (0.1ms) ROLLBACK
327
-  (0.1ms) BEGIN
328
- ------------------------------------------------------------------
329
- S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
330
- ------------------------------------------------------------------
331
-  (0.1ms) SAVEPOINT active_record_1
332
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-04-14 17:07:11.361956"], ["pending_at", "2016-04-14 17:07:11.361695"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.361956"]]
333
-  (0.1ms) RELEASE SAVEPOINT active_record_1
334
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
335
-  (0.1ms) ROLLBACK
336
-  (0.1ms) BEGIN
337
- ---------------------------------------------------------------------------------
338
- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
339
- ---------------------------------------------------------------------------------
340
-  (0.1ms) SAVEPOINT active_record_1
341
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.367148"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.367148"]]
342
-  (0.1ms) RELEASE SAVEPOINT active_record_1
343
-  (0.1ms) ROLLBACK
344
-  (0.1ms) BEGIN
345
-  (0.1ms) COMMIT
346
-  (0.1ms) BEGIN
347
-  (0.1ms) SAVEPOINT active_record_1
348
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-04-14 17:07:11.370704"], ["name", "Flux Capacitor"], ["updated_at", "2016-04-14 17:07:11.370704"]]
349
-  (0.1ms) RELEASE SAVEPOINT active_record_1
350
-  (0.1ms) SAVEPOINT active_record_1
351
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
352
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
353
- :format: 1
354
- ' LIMIT 1
355
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.373006"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.371699"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.373006"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
356
-  (0.1ms) RELEASE SAVEPOINT active_record_1
357
-  (0.1ms) SAVEPOINT active_record_1
358
- S3Relay::Upload Exists (0.1ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
359
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
360
- :format: 1
361
- ' LIMIT 1
362
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.375200"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.374185"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.375200"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
363
-  (0.1ms) RELEASE SAVEPOINT active_record_1
364
-  (0.1ms) SAVEPOINT active_record_1
365
- S3Relay::Upload Exists (0.1ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
366
- :value: 87bcb4f5-3358-414c-9b2b-8d39318e36b1
367
- :format: 1
368
- ' LIMIT 1
369
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-04-14 17:07:11.377376"], ["filename", "cat.png"], ["parent_id", 9], ["parent_type", "Product"], ["pending_at", "2016-04-14 17:07:11.376288"], ["state", "pending"], ["updated_at", "2016-04-14 17:07:11.377376"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
370
-  (0.1ms) RELEASE SAVEPOINT active_record_1
371
-  (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'
372
-  (0.1ms) ROLLBACK
373
-  (0.1ms) BEGIN
374
- --------------------------------------------------------------------
375
- S3Relay::Upload::validations::filename: test_0001_validates presence
376
- --------------------------------------------------------------------
377
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
378
-  (0.1ms) ROLLBACK
379
-  (0.1ms) BEGIN
380
-  (0.1ms) COMMIT
381
-  (0.1ms) BEGIN
382
-  (0.1ms) ROLLBACK
383
-  (0.1ms) BEGIN
384
- -----------------------------------------------------------------------
385
- S3Relay::Upload::validations::upload_type: test_0001_validates presence
386
- -----------------------------------------------------------------------
387
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
388
-  (0.1ms) ROLLBACK
389
- SQL (0.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
390
-  (14.5ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying(255), "created_at" timestamp, "updated_at" timestamp)
391
-  (3.7ms) 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) 
392
-  (0.7ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
393
-  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
394
-  (0.2ms) SELECT version FROM "schema_migrations"
395
-  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141021002149')
396
-  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141009000804')
397
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
398
-  (0.4ms) ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL
399
-  (1.1ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
400
-  (3.2ms) TRUNCATE TABLE "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
401
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
402
-  (0.2ms) BEGIN
403
- ---------------------------------------------------------------------------------------------------------------------
404
- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
405
- ---------------------------------------------------------------------------------------------------------------------
406
-  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
407
- Processing by S3Relay::UploadsController#create as HTML
408
- Parameters: {"association"=>"photo_uploads", "uuid"=>"0e5c4bfe-2c72-4ab5-80c5-7819430e7348", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
409
- Product Load (0.4ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
410
-  (0.1ms) SAVEPOINT active_record_1
411
- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
412
- :value: 0e5c4bfe-2c72-4ab5-80c5-7819430e7348
413
- :format: 1
414
- ' LIMIT 1
415
- 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", "2016-09-07 16:33:45.419053"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.407270"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.419053"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
416
-  (0.2ms) RELEASE SAVEPOINT active_record_1
417
- Completed 201 Created in 36ms (Views: 0.2ms | ActiveRecord: 3.1ms)
418
-  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
419
-  (0.1ms) ROLLBACK
420
-  (0.1ms) BEGIN
421
- ----------------------------------------------------------------
422
- S3Relay::Upload::validations::uuid: test_0001_validates presence
423
- ----------------------------------------------------------------
424
- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
425
-  (0.1ms) ROLLBACK
426
-  (0.1ms) BEGIN
427
- ------------------------------------------------------------------
428
- S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
429
- ------------------------------------------------------------------
430
-  (0.1ms) SAVEPOINT active_record_1
431
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:33:45.439905"], ["pending_at", "2016-09-07 16:33:45.439498"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.439905"]]
432
-  (0.1ms) RELEASE SAVEPOINT active_record_1
433
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
434
-  (0.1ms) ROLLBACK
435
-  (0.1ms) BEGIN
436
-  (0.1ms) COMMIT
437
-  (0.1ms) BEGIN
438
-  (0.1ms) ROLLBACK
439
-  (0.1ms) BEGIN
440
- --------------------------------------------------------
441
- S3Relay::UploadsController::GET new: test_0001_anonymous
442
- --------------------------------------------------------
443
- Processing by S3Relay::UploadsController#new as HTML
444
- Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)
445
-  (0.1ms) ROLLBACK
446
-  (0.2ms) BEGIN
447
- -------------------------------------------------------
448
- S3Relay::Upload::upon finalization: test_0001_anonymous
449
- -------------------------------------------------------
450
-  (0.2ms) ROLLBACK
451
-  (0.1ms) BEGIN
452
- -----------------------------------------------
453
- S3Relay::Upload::#imported: test_0001_anonymous
454
- -----------------------------------------------
455
-  (0.1ms) ROLLBACK
456
-  (0.1ms) BEGIN
457
- -----------------------------------------------
458
- S3Relay::Upload::#pending?: test_0001_anonymous
459
- -----------------------------------------------
460
-  (0.1ms) ROLLBACK
461
-  (0.1ms) BEGIN
462
- --------------------------------------------------
463
- S3Relay::Upload::#private_url: test_0001_anonymous
464
- --------------------------------------------------
465
-  (0.1ms) ROLLBACK
466
-  (0.1ms) BEGIN
467
- ---------------------------------------------------------------------------------
468
- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
469
- ---------------------------------------------------------------------------------
470
-  (0.1ms) SAVEPOINT active_record_1
471
- SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.467004"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.467004"]]
472
-  (0.1ms) RELEASE SAVEPOINT active_record_1
473
-  (0.1ms) ROLLBACK
474
-  (0.1ms) BEGIN
475
- ----------------------------------------------------------
476
- S3Relay::Upload::associations::parent: test_0001_anonymous
477
- ----------------------------------------------------------
478
-  (0.1ms) ROLLBACK
479
-  (0.1ms) BEGIN
480
- ------------------------------------------------------------------------------------------
481
- S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
482
- ------------------------------------------------------------------------------------------
483
-  (0.1ms) SAVEPOINT active_record_1
484
- SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.475544"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.475544"]]
485
-  (0.1ms) RELEASE SAVEPOINT active_record_1
486
-  (0.1ms) ROLLBACK
487
-  (0.1ms) BEGIN
488
- -----------------------------------------------------------------------------------
489
- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
490
- -----------------------------------------------------------------------------------
491
-  (0.1ms) SAVEPOINT active_record_1
492
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.480164"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.480164"]]
493
-  (0.1ms) RELEASE SAVEPOINT active_record_1
494
-  (0.1ms) SAVEPOINT active_record_1
495
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
496
- :value: 356d4976-4484-4656-a052-48da223b71c3
497
- :format: 1
498
- ' LIMIT 1
499
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.483102"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.479441"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.483102"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
500
-  (0.1ms) RELEASE SAVEPOINT active_record_1
501
-  (0.1ms) ROLLBACK
502
-  (0.1ms) BEGIN
503
-  (0.1ms) COMMIT
504
-  (0.1ms) BEGIN
505
-  (0.1ms) SAVEPOINT active_record_1
506
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.486877"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.486877"]]
507
-  (0.1ms) RELEASE SAVEPOINT active_record_1
508
-  (0.1ms) SAVEPOINT active_record_1
509
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
510
- :value: 356d4976-4484-4656-a052-48da223b71c3
511
- :format: 1
512
- ' LIMIT 1
513
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.489710"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.488176"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.489710"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
514
-  (0.1ms) RELEASE SAVEPOINT active_record_1
515
-  (0.1ms) SAVEPOINT active_record_1
516
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
517
- :value: 356d4976-4484-4656-a052-48da223b71c3
518
- :format: 1
519
- ' LIMIT 1
520
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.492641"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.491298"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.492641"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
521
-  (0.1ms) RELEASE SAVEPOINT active_record_1
522
-  (0.1ms) SAVEPOINT active_record_1
523
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
524
- :value: 356d4976-4484-4656-a052-48da223b71c3
525
- :format: 1
526
- ' LIMIT 1
527
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.495423"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.494078"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.495423"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
528
-  (0.1ms) RELEASE SAVEPOINT active_record_1
529
-  (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'
530
-  (0.1ms) ROLLBACK
531
-  (0.1ms) BEGIN
532
- -----------------------------------------------------------------------------------------------------------------
533
- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
534
- -----------------------------------------------------------------------------------------------------------------
535
-  (0.1ms) SAVEPOINT active_record_1
536
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.501210"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.501210"]]
537
-  (0.1ms) RELEASE SAVEPOINT active_record_1
538
-  (0.2ms) 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'
539
- Processing by S3Relay::UploadsController#create as HTML
540
- Parameters: {"association"=>"photo_uploads", "uuid"=>"c4ccd03c-c40b-45a1-b3fd-30189c243c74", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"}
541
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 5 LIMIT 1
542
-  (0.1ms) SAVEPOINT active_record_1
543
- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
544
- :value: c4ccd03c-c40b-45a1-b3fd-30189c243c74
545
- :format: 1
546
- ' LIMIT 1
547
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.508279"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.506024"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.508279"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
548
-  (0.1ms) RELEASE SAVEPOINT active_record_1
549
- Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.0ms)
550
-  (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'
551
-  (0.1ms) ROLLBACK
552
-  (0.1ms) BEGIN
553
- --------------------------------------------------------------------
554
- S3Relay::Upload::validations::filename: test_0001_validates presence
555
- --------------------------------------------------------------------
556
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
557
-  (0.1ms) ROLLBACK
558
-  (0.1ms) BEGIN
559
-  (0.1ms) COMMIT
560
-  (0.1ms) BEGIN
561
-  (0.1ms) SAVEPOINT active_record_1
562
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.516854"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.516854"]]
563
-  (0.1ms) RELEASE SAVEPOINT active_record_1
564
-  (0.1ms) SAVEPOINT active_record_1
565
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
566
- :value: 356d4976-4484-4656-a052-48da223b71c3
567
- :format: 1
568
- ' LIMIT 1
569
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.519653"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.518088"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.519653"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
570
-  (0.1ms) RELEASE SAVEPOINT active_record_1
571
-  (0.1ms) SAVEPOINT active_record_1
572
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
573
- :value: 356d4976-4484-4656-a052-48da223b71c3
574
- :format: 1
575
- ' LIMIT 1
576
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.522536"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.521159"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.522536"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
577
-  (0.1ms) RELEASE SAVEPOINT active_record_1
578
-  (0.1ms) SAVEPOINT active_record_1
579
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
580
- :value: 356d4976-4484-4656-a052-48da223b71c3
581
- :format: 1
582
- ' LIMIT 1
583
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.525076"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:33:45.523819"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.525076"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
584
-  (0.1ms) RELEASE SAVEPOINT active_record_1
585
- 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" = 6 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1
586
-  (0.1ms) ROLLBACK
587
-  (0.1ms) BEGIN
588
- -------------------------------------------------------------------
589
- S3Relay::UploadsController::POST create::error: test_0001_anonymous
590
- -------------------------------------------------------------------
591
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
592
- Processing by S3Relay::UploadsController#create as HTML
593
- Parameters: {"uuid"=>"d19d0438-4df4-47b1-8a5e-2ed27bacf32a", "filename"=>"cat.png", "content_type"=>"image/png"}
594
-  (0.1ms) SAVEPOINT active_record_1
595
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
596
- :value: d19d0438-4df4-47b1-8a5e-2ed27bacf32a
597
- :format: 1
598
- ' LIMIT 1
599
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
600
- Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.4ms)
601
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
602
-  (0.1ms) ROLLBACK
603
-  (0.1ms) BEGIN
604
-  (0.1ms) COMMIT
605
-  (0.1ms) BEGIN
606
-  (0.1ms) SAVEPOINT active_record_1
607
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.536751"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.536751"]]
608
-  (0.1ms) RELEASE SAVEPOINT active_record_1
609
-  (0.1ms) SAVEPOINT active_record_1
610
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
611
- :value: 356d4976-4484-4656-a052-48da223b71c3
612
- :format: 1
613
- ' LIMIT 1
614
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.539221"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.537947"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.539221"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
615
-  (0.1ms) RELEASE SAVEPOINT active_record_1
616
-  (0.1ms) SAVEPOINT active_record_1
617
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
618
- :value: 356d4976-4484-4656-a052-48da223b71c3
619
- :format: 1
620
- ' LIMIT 1
621
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.541626"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.540488"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.541626"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
622
-  (0.1ms) RELEASE SAVEPOINT active_record_1
623
-  (0.1ms) SAVEPOINT active_record_1
624
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
625
- :value: 356d4976-4484-4656-a052-48da223b71c3
626
- :format: 1
627
- ' LIMIT 1
628
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.543980"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.542841"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.543980"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
629
-  (0.1ms) RELEASE SAVEPOINT active_record_1
630
- 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" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
631
- SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 7 WHERE "s3_relay_uploads"."uuid" IN ('356d4976-4484-4656-a052-48da223b71c3', '356d4976-4484-4656-a052-48da223b71c3') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
632
- 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" = 7 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
633
-  (0.1ms) ROLLBACK
634
-  (0.1ms) BEGIN
635
-  (0.1ms) COMMIT
636
-  (0.1ms) BEGIN
637
-  (0.1ms) SAVEPOINT active_record_1
638
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.548658"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.548658"]]
639
-  (0.1ms) RELEASE SAVEPOINT active_record_1
640
-  (0.1ms) SAVEPOINT active_record_1
641
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
642
- :value: 356d4976-4484-4656-a052-48da223b71c3
643
- :format: 1
644
- ' LIMIT 1
645
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.550952"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.549783"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.550952"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
646
-  (0.1ms) RELEASE SAVEPOINT active_record_1
647
-  (0.1ms) SAVEPOINT active_record_1
648
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
649
- :value: 356d4976-4484-4656-a052-48da223b71c3
650
- :format: 1
651
- ' LIMIT 1
652
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.553251"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.552150"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.553251"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
653
-  (0.1ms) RELEASE SAVEPOINT active_record_1
654
-  (0.2ms) SAVEPOINT active_record_1
655
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
656
- :value: 356d4976-4484-4656-a052-48da223b71c3
657
- :format: 1
658
- ' LIMIT 1
659
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.556822"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.554746"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.556822"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
660
-  (0.1ms) RELEASE SAVEPOINT active_record_1
661
- 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
662
-  (0.1ms) ROLLBACK
663
-  (0.2ms) BEGIN
664
-  (0.1ms) COMMIT
665
-  (0.1ms) BEGIN
666
-  (0.1ms) ROLLBACK
667
-  (0.1ms) BEGIN
668
- -----------------------------------------------------------------------
669
- S3Relay::Upload::validations::upload_type: test_0001_validates presence
670
- -----------------------------------------------------------------------
671
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
672
-  (0.1ms) ROLLBACK
673
-  (0.1ms) BEGIN
674
- --------------------------------------------------------------------------------------------------------------------------------------------
675
- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
676
- --------------------------------------------------------------------------------------------------------------------------------------------
677
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
678
- Processing by S3Relay::UploadsController#create as HTML
679
- Parameters: {"association"=>"photo_uploads", "uuid"=>"0f88c4e6-2ca2-489b-9636-8375f181c9c6", "filename"=>"cat.png", "content_type"=>"image/png"}
680
-  (0.1ms) SAVEPOINT active_record_1
681
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
682
- :value: 0f88c4e6-2ca2-489b-9636-8375f181c9c6
683
- :format: 1
684
- ' LIMIT 1
685
- 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", "2016-09-07 16:33:45.573298"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.571989"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.573298"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
686
-  (0.1ms) RELEASE SAVEPOINT active_record_1
687
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
688
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
689
-  (0.1ms) ROLLBACK
690
-  (0.1ms) BEGIN
691
- -----------------------------------------------------
692
- S3Relay::Upload::#mark_imported!: test_0001_anonymous
693
- -----------------------------------------------------
694
-  (0.1ms) SAVEPOINT active_record_1
695
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
696
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
697
-  (0.1ms) ROLLBACK
698
-  (0.1ms) BEGIN
699
- -----------------------------------------------------
700
- S3Relay::Upload::scopes::pending: test_0001_anonymous
701
- -----------------------------------------------------
702
-  (0.1ms) SAVEPOINT active_record_1
703
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:33:45.581791"], ["pending_at", "2016-09-07 16:33:45.581566"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.581791"]]
704
-  (0.1ms) RELEASE SAVEPOINT active_record_1
705
-  (0.1ms) SAVEPOINT active_record_1
706
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:33:45.583119"], ["pending_at", "2016-09-07 16:33:45.582860"], ["state", "imported"], ["updated_at", "2016-09-07 16:33:45.583119"]]
707
-  (0.1ms) RELEASE SAVEPOINT active_record_1
708
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'
709
-  (0.1ms) ROLLBACK
710
-  (0.1ms) BEGIN
711
-  (0.1ms) COMMIT
712
-  (0.1ms) BEGIN
713
-  (0.1ms) ROLLBACK
714
-  (0.1ms) BEGIN
715
- ----------------------------------------------------------------------
716
- S3Relay::Upload::validations::pending_at: test_0001_validates presence
717
- ----------------------------------------------------------------------
718
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
719
-  (0.1ms) ROLLBACK
720
-  (0.1ms) BEGIN
721
- -----------------------------------------------------------------------------
722
- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
723
- -----------------------------------------------------------------------------
724
-  (0.1ms) SAVEPOINT active_record_1
725
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:33:45.593913"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:33:45.593913"]]
726
-  (0.1ms) RELEASE SAVEPOINT active_record_1
727
-  (0.1ms) ROLLBACK
728
-  (0.1ms) BEGIN
729
- ------------------------------------------------------
730
- S3Relay::Upload::scopes::imported: test_0001_anonymous
731
- ------------------------------------------------------
732
-  (0.1ms) SAVEPOINT active_record_1
733
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:33:45.596650"], ["pending_at", "2016-09-07 16:33:45.596420"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.596650"]]
734
-  (0.1ms) RELEASE SAVEPOINT active_record_1
735
-  (0.1ms) SAVEPOINT active_record_1
736
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:33:45.598046"], ["pending_at", "2016-09-07 16:33:45.597776"], ["state", "imported"], ["updated_at", "2016-09-07 16:33:45.598046"]]
737
-  (0.1ms) RELEASE SAVEPOINT active_record_1
738
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
739
-  (0.1ms) ROLLBACK
740
-  (0.1ms) BEGIN
741
-  (0.1ms) COMMIT
742
-  (0.1ms) BEGIN
743
-  (0.1ms) ROLLBACK
744
-  (0.1ms) BEGIN
745
-  (0.1ms) COMMIT
746
-  (0.0ms) BEGIN
747
-  (0.1ms) ROLLBACK
748
-  (0.1ms) BEGIN
749
- ---------------------------------------------------------------------
750
- S3Relay::UploadsController::POST create::success: test_0001_anonymous
751
- ---------------------------------------------------------------------
752
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
753
- Processing by S3Relay::UploadsController#create as HTML
754
- Parameters: {"association"=>"photo_uploads", "uuid"=>"a233b082-5ac9-4aa9-9e7f-9691d061d2d6", "filename"=>"cat.png", "content_type"=>"image/png"}
755
-  (0.1ms) SAVEPOINT active_record_1
756
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
757
- :value: a233b082-5ac9-4aa9-9e7f-9691d061d2d6
758
- :format: 1
759
- ' LIMIT 1
760
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:33:45.607065"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:33:45.605776"], ["state", "pending"], ["updated_at", "2016-09-07 16:33:45.607065"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
761
-  (0.1ms) RELEASE SAVEPOINT active_record_1
762
- Completed 201 Created in 3ms (Views: 0.2ms | ActiveRecord: 0.6ms)
763
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
764
-  (0.1ms) ROLLBACK
765
-  (0.1ms) BEGIN
766
-  (0.1ms) COMMIT
767
-  (0.1ms) BEGIN
768
-  (0.1ms) ROLLBACK
769
-  (0.1ms) BEGIN
770
- ------------------------------------------------------------------------
771
- S3Relay::Upload::validations::content_type: test_0001_validates presence
772
- ------------------------------------------------------------------------
773
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
774
-  (0.1ms) ROLLBACK
775
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
776
-  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
777
-  (1.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
778
-  (5.5ms) TRUNCATE TABLE "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
779
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
780
-  (0.2ms) BEGIN
781
-  (0.1ms) COMMIT
782
-  (0.1ms) BEGIN
783
-  (0.1ms) ROLLBACK
784
-  (0.1ms) BEGIN
785
- -----------------------------------------------------------------------
786
- S3Relay::Upload::validations::upload_type: test_0001_validates presence
787
- -----------------------------------------------------------------------
788
- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
789
-  (0.1ms) ROLLBACK
790
-  (0.1ms) BEGIN
791
- ----------------------------------------------------------------------
792
- S3Relay::Upload::validations::pending_at: test_0001_validates presence
793
- ----------------------------------------------------------------------
794
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
795
-  (0.1ms) ROLLBACK
796
-  (0.1ms) BEGIN
797
- --------------------------------------------------
798
- S3Relay::Upload::#private_url: test_0001_anonymous
799
- --------------------------------------------------
800
-  (0.1ms) ROLLBACK
801
-  (0.1ms) BEGIN
802
- --------------------------------------------------------------------
803
- S3Relay::Upload::validations::filename: test_0001_validates presence
804
- --------------------------------------------------------------------
805
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
806
-  (0.1ms) ROLLBACK
807
-  (0.1ms) BEGIN
808
- ------------------------------------------------------------------------
809
- S3Relay::Upload::validations::content_type: test_0001_validates presence
810
- ------------------------------------------------------------------------
811
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
812
-  (0.1ms) ROLLBACK
813
-  (0.1ms) BEGIN
814
-  (0.1ms) COMMIT
815
-  (0.1ms) BEGIN
816
-  (0.1ms) SAVEPOINT active_record_1
817
- SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.062528"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.062528"]]
818
-  (0.2ms) RELEASE SAVEPOINT active_record_1
819
-  (0.1ms) SAVEPOINT active_record_1
820
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
821
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
822
- :format: 1
823
- ' LIMIT 1
824
- 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", "2016-09-07 16:34:53.067985"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.066150"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.067985"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
825
-  (0.1ms) RELEASE SAVEPOINT active_record_1
826
-  (0.1ms) SAVEPOINT active_record_1
827
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
828
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
829
- :format: 1
830
- ' LIMIT 1
831
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.076411"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.074689"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.076411"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
832
-  (0.1ms) RELEASE SAVEPOINT active_record_1
833
-  (0.1ms) SAVEPOINT active_record_1
834
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
835
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
836
- :format: 1
837
- ' LIMIT 1
838
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.079223"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.077950"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.079223"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
839
-  (0.1ms) RELEASE SAVEPOINT active_record_1
840
- 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'
841
- SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 1 WHERE "s3_relay_uploads"."uuid" IN ('bb66867f-e23a-4b65-93cd-61cab6718c14', 'bb66867f-e23a-4b65-93cd-61cab6718c14') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
842
- 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'
843
-  (0.2ms) ROLLBACK
844
-  (0.1ms) BEGIN
845
-  (0.1ms) COMMIT
846
-  (0.1ms) BEGIN
847
-  (0.1ms) SAVEPOINT active_record_1
848
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.087866"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.087866"]]
849
-  (0.1ms) RELEASE SAVEPOINT active_record_1
850
-  (0.1ms) SAVEPOINT active_record_1
851
- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
852
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
853
- :format: 1
854
- ' LIMIT 1
855
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.091528"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.089356"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.091528"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
856
-  (0.2ms) RELEASE SAVEPOINT active_record_1
857
-  (0.1ms) SAVEPOINT active_record_1
858
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
859
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
860
- :format: 1
861
- ' LIMIT 1
862
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.095508"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.093949"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.095508"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
863
-  (0.1ms) RELEASE SAVEPOINT active_record_1
864
-  (0.1ms) SAVEPOINT active_record_1
865
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
866
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
867
- :format: 1
868
- ' LIMIT 1
869
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.098932"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.097102"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.098932"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
870
-  (0.1ms) RELEASE SAVEPOINT active_record_1
871
-  (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'
872
-  (0.1ms) ROLLBACK
873
-  (0.1ms) BEGIN
874
-  (0.1ms) COMMIT
875
-  (0.1ms) BEGIN
876
-  (0.2ms) SAVEPOINT active_record_1
877
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.104227"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.104227"]]
878
-  (0.1ms) RELEASE SAVEPOINT active_record_1
879
-  (0.1ms) SAVEPOINT active_record_1
880
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
881
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
882
- :format: 1
883
- ' LIMIT 1
884
- 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", "2016-09-07 16:34:53.108076"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.106180"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.108076"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
885
-  (0.2ms) RELEASE SAVEPOINT active_record_1
886
-  (0.2ms) SAVEPOINT active_record_1
887
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
888
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
889
- :format: 1
890
- ' LIMIT 1
891
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.111773"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.110134"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.111773"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
892
-  (0.1ms) RELEASE SAVEPOINT active_record_1
893
-  (0.1ms) SAVEPOINT active_record_1
894
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
895
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
896
- :format: 1
897
- ' LIMIT 1
898
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.114633"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.113260"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.114633"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
899
-  (0.1ms) RELEASE SAVEPOINT active_record_1
900
- 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
901
-  (0.1ms) ROLLBACK
902
-  (0.2ms) BEGIN
903
- ------------------------------------------------------
904
- S3Relay::Upload::scopes::imported: test_0001_anonymous
905
- ------------------------------------------------------
906
-  (0.2ms) SAVEPOINT active_record_1
907
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:34:53.119514"], ["pending_at", "2016-09-07 16:34:53.119013"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.119514"]]
908
-  (0.2ms) RELEASE SAVEPOINT active_record_1
909
-  (0.1ms) SAVEPOINT active_record_1
910
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:34:53.121838"], ["pending_at", "2016-09-07 16:34:53.121463"], ["state", "imported"], ["updated_at", "2016-09-07 16:34:53.121838"]]
911
-  (0.1ms) RELEASE SAVEPOINT active_record_1
912
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
913
-  (0.1ms) ROLLBACK
914
-  (0.1ms) BEGIN
915
- -----------------------------------------------------
916
- S3Relay::Upload::scopes::pending: test_0001_anonymous
917
- -----------------------------------------------------
918
-  (0.1ms) SAVEPOINT active_record_1
919
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:34:53.126702"], ["pending_at", "2016-09-07 16:34:53.126384"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.126702"]]
920
-  (0.1ms) RELEASE SAVEPOINT active_record_1
921
-  (0.1ms) SAVEPOINT active_record_1
922
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:34:53.128365"], ["pending_at", "2016-09-07 16:34:53.128075"], ["state", "imported"], ["updated_at", "2016-09-07 16:34:53.128365"]]
923
-  (0.1ms) RELEASE SAVEPOINT active_record_1
924
- S3Relay::Upload Load (0.3ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'
925
-  (0.1ms) ROLLBACK
926
-  (0.1ms) BEGIN
927
- ---------------------------------------------------------------------------------
928
- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
929
- ---------------------------------------------------------------------------------
930
-  (0.1ms) SAVEPOINT active_record_1
931
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.134199"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.134199"]]
932
-  (0.1ms) RELEASE SAVEPOINT active_record_1
933
-  (0.1ms) ROLLBACK
934
-  (0.1ms) BEGIN
935
- --------------------------------------------------------
936
- S3Relay::UploadsController::GET new: test_0001_anonymous
937
- --------------------------------------------------------
938
- Processing by S3Relay::UploadsController#new as HTML
939
- Completed 200 OK in 2ms (Views: 0.3ms | ActiveRecord: 0.0ms)
940
-  (0.1ms) ROLLBACK
941
-  (0.1ms) BEGIN
942
- --------------------------------------------------------------------------------------------------------------------------------------------
943
- S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
944
- --------------------------------------------------------------------------------------------------------------------------------------------
945
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
946
- Processing by S3Relay::UploadsController#create as HTML
947
- Parameters: {"association"=>"photo_uploads", "uuid"=>"f6cb3d96-1e8a-497a-9150-ea7b28ad06be", "filename"=>"cat.png", "content_type"=>"image/png"}
948
-  (0.2ms) SAVEPOINT active_record_1
949
- S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
950
- :value: f6cb3d96-1e8a-497a-9150-ea7b28ad06be
951
- :format: 1
952
- ' LIMIT 1
953
- 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", "2016-09-07 16:34:53.152389"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.149758"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.152389"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
954
-  (0.1ms) RELEASE SAVEPOINT active_record_1
955
- Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 0.9ms)
956
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
957
-  (0.1ms) ROLLBACK
958
-  (0.1ms) BEGIN
959
-  (0.1ms) COMMIT
960
-  (0.1ms) BEGIN
961
-  (0.1ms) SAVEPOINT active_record_1
962
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.158187"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.158187"]]
963
-  (0.1ms) RELEASE SAVEPOINT active_record_1
964
-  (0.1ms) SAVEPOINT active_record_1
965
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
966
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
967
- :format: 1
968
- ' LIMIT 1
969
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.160684"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.159378"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.160684"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
970
-  (0.1ms) RELEASE SAVEPOINT active_record_1
971
-  (0.1ms) SAVEPOINT active_record_1
972
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
973
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
974
- :format: 1
975
- ' LIMIT 1
976
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.162961"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.161939"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.162961"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
977
-  (0.1ms) RELEASE SAVEPOINT active_record_1
978
-  (0.1ms) SAVEPOINT active_record_1
979
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
980
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
981
- :format: 1
982
- ' LIMIT 1
983
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.165307"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.164193"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.165307"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
984
-  (0.1ms) RELEASE SAVEPOINT active_record_1
985
- 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" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1
986
-  (0.1ms) ROLLBACK
987
-  (0.1ms) BEGIN
988
- -------------------------------------------------------
989
- S3Relay::Upload::upon finalization: test_0001_anonymous
990
- -------------------------------------------------------
991
-  (0.1ms) ROLLBACK
992
-  (0.1ms) BEGIN
993
- -----------------------------------------------
994
- S3Relay::Upload::#imported: test_0001_anonymous
995
- -----------------------------------------------
996
-  (0.1ms) ROLLBACK
997
-  (0.1ms) BEGIN
998
- -----------------------------------------------------------------------------------------------------------------
999
- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
1000
- -----------------------------------------------------------------------------------------------------------------
1001
-  (0.1ms) SAVEPOINT active_record_1
1002
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.173573"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.173573"]]
1003
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1004
-  (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'
1005
- Processing by S3Relay::UploadsController#create as HTML
1006
- Parameters: {"association"=>"photo_uploads", "uuid"=>"3aa3d439-ed71-44c1-91e4-18499be8a080", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"6"}
1007
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 6 LIMIT 1
1008
-  (0.1ms) SAVEPOINT active_record_1
1009
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1010
- :value: 3aa3d439-ed71-44c1-91e4-18499be8a080
1011
- :format: 1
1012
- ' LIMIT 1
1013
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.180270"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.178717"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.180270"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1014
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1015
- Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.9ms)
1016
-  (0.2ms) 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'
1017
-  (0.1ms) ROLLBACK
1018
-  (0.1ms) BEGIN
1019
-  (0.1ms) COMMIT
1020
-  (0.1ms) BEGIN
1021
-  (0.1ms) ROLLBACK
1022
-  (0.1ms) BEGIN
1023
-  (0.1ms) COMMIT
1024
-  (0.1ms) BEGIN
1025
-  (0.1ms) ROLLBACK
1026
-  (0.1ms) BEGIN
1027
-  (0.1ms) COMMIT
1028
-  (0.1ms) BEGIN
1029
-  (0.1ms) ROLLBACK
1030
-  (0.1ms) BEGIN
1031
- -----------------------------------------------
1032
- S3Relay::Upload::#pending?: test_0001_anonymous
1033
- -----------------------------------------------
1034
-  (0.1ms) ROLLBACK
1035
-  (0.1ms) BEGIN
1036
- -----------------------------------------------------
1037
- S3Relay::Upload::#mark_imported!: test_0001_anonymous
1038
- -----------------------------------------------------
1039
-  (0.1ms) SAVEPOINT active_record_1
1040
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1041
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1042
-  (0.1ms) ROLLBACK
1043
-  (0.1ms) BEGIN
1044
- -----------------------------------------------------------------------------------
1045
- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
1046
- -----------------------------------------------------------------------------------
1047
-  (0.1ms) SAVEPOINT active_record_1
1048
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.195608"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.195608"]]
1049
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1050
-  (0.1ms) SAVEPOINT active_record_1
1051
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1052
- :value: bb66867f-e23a-4b65-93cd-61cab6718c14
1053
- :format: 1
1054
- ' LIMIT 1
1055
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.198154"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:34:53.194984"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.198154"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
1056
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1057
-  (0.1ms) ROLLBACK
1058
-  (0.1ms) BEGIN
1059
- -----------------------------------------------------------------------------
1060
- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
1061
- -----------------------------------------------------------------------------
1062
-  (0.1ms) SAVEPOINT active_record_1
1063
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.201558"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.201558"]]
1064
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1065
-  (0.1ms) ROLLBACK
1066
-  (0.1ms) BEGIN
1067
-  (0.1ms) COMMIT
1068
-  (0.1ms) BEGIN
1069
-  (0.1ms) ROLLBACK
1070
-  (0.1ms) BEGIN
1071
- ------------------------------------------------------------------------------------------
1072
- S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
1073
- ------------------------------------------------------------------------------------------
1074
396
   (0.1ms) SAVEPOINT active_record_1
1075
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:34:53.206480"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:34:53.206480"]]
397
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.893511"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.893511"]]
1076
398
   (0.1ms) RELEASE SAVEPOINT active_record_1
1077
399
   (0.1ms) ROLLBACK
1078
400
   (0.1ms) BEGIN
@@ -1080,311 +402,140 @@ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001
1080
402
  S3Relay::UploadsController::POST create::success: test_0001_anonymous
1081
403
  ---------------------------------------------------------------------
1082
404
   (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1083
- Processing by S3Relay::UploadsController#create as HTML
1084
- Parameters: {"association"=>"photo_uploads", "uuid"=>"01988f6c-3e2a-4d19-8b54-f53e01c3b1c7", "filename"=>"cat.png", "content_type"=>"image/png"}
1085
-  (0.1ms) SAVEPOINT active_record_1
1086
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1087
- :value: 01988f6c-3e2a-4d19-8b54-f53e01c3b1c7
1088
- :format: 1
1089
- ' LIMIT 1
1090
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.214229"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.212902"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.214229"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1091
-  (0.2ms) RELEASE SAVEPOINT active_record_1
1092
- Completed 201 Created in 4ms (Views: 0.3ms | ActiveRecord: 0.7ms)
1093
-  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1094
-  (0.2ms) ROLLBACK
1095
-  (0.1ms) BEGIN
1096
- ----------------------------------------------------------------
1097
- S3Relay::Upload::validations::uuid: test_0001_validates presence
1098
- ----------------------------------------------------------------
1099
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1100
-  (0.1ms) ROLLBACK
1101
-  (0.1ms) BEGIN
1102
- ------------------------------------------------------------------
1103
- S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
1104
- ------------------------------------------------------------------
1105
-  (0.1ms) SAVEPOINT active_record_1
1106
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:34:53.223765"], ["pending_at", "2016-09-07 16:34:53.223475"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.223765"]]
1107
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1108
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1109
-  (0.1ms) ROLLBACK
1110
-  (0.1ms) BEGIN
1111
- ---------------------------------------------------------------------------------------------------------------------
1112
- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
1113
- ---------------------------------------------------------------------------------------------------------------------
1114
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1115
- Processing by S3Relay::UploadsController#create as HTML
1116
- Parameters: {"association"=>"photo_uploads", "uuid"=>"7add59ac-43d1-4762-b858-9f002d363c02", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
1117
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
1118
-  (0.1ms) SAVEPOINT active_record_1
1119
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1120
- :value: 7add59ac-43d1-4762-b858-9f002d363c02
1121
- :format: 1
1122
- ' LIMIT 1
1123
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:34:53.235583"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:34:53.233235"], ["state", "pending"], ["updated_at", "2016-09-07 16:34:53.235583"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1124
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1125
- Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)
1126
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1127
-  (0.1ms) ROLLBACK
1128
-  (0.1ms) BEGIN
1129
- -------------------------------------------------------------------
1130
- S3Relay::UploadsController::POST create::error: test_0001_anonymous
1131
- -------------------------------------------------------------------
1132
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1133
- Processing by S3Relay::UploadsController#create as HTML
1134
- Parameters: {"uuid"=>"2f57f99e-d3b3-4226-a4d2-7c438bd0e6fd", "filename"=>"cat.png", "content_type"=>"image/png"}
1135
-  (0.1ms) SAVEPOINT active_record_1
1136
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1137
- :value: 2f57f99e-d3b3-4226-a4d2-7c438bd0e6fd
1138
- :format: 1
1139
- ' LIMIT 1
1140
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1141
- Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.5ms)
1142
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1143
-  (0.1ms) ROLLBACK
1144
-  (0.1ms) BEGIN
1145
- ----------------------------------------------------------
1146
- S3Relay::Upload::associations::parent: test_0001_anonymous
1147
- ----------------------------------------------------------
1148
-  (0.1ms) ROLLBACK
1149
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1150
-  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
1151
-  (2.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
1152
-  (4.6ms) TRUNCATE TABLE "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
1153
-  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
1154
-  (0.2ms) BEGIN
1155
- --------------------------------------------------------
1156
- S3Relay::UploadsController::GET new: test_0001_anonymous
1157
- --------------------------------------------------------
1158
- Processing by S3Relay::UploadsController#new as HTML
1159
- Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)
1160
-  (0.2ms) ROLLBACK
1161
-  (0.1ms) BEGIN
1162
- -----------------------------------------------------------------------------
1163
- S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
1164
- -----------------------------------------------------------------------------
1165
-  (0.2ms) SAVEPOINT active_record_1
1166
- SQL (0.5ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.408574"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.408574"]]
1167
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1168
-  (0.1ms) ROLLBACK
1169
-  (0.1ms) BEGIN
1170
-  (0.1ms) COMMIT
1171
-  (0.1ms) BEGIN
1172
-  (0.1ms) SAVEPOINT active_record_1
1173
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.415759"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.415759"]]
1174
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1175
-  (0.1ms) SAVEPOINT active_record_1
1176
- S3Relay::Upload Exists (0.5ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1177
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
1178
- :format: 1
1179
- ' LIMIT 1
1180
- 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", "2016-09-07 16:35:33.436619"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.426094"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.436619"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
1181
-  (0.2ms) RELEASE SAVEPOINT active_record_1
1182
-  (0.1ms) SAVEPOINT active_record_1
1183
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1184
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
1185
- :format: 1
1186
- ' LIMIT 1
1187
- 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", "2016-09-07 16:35:33.441855"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.439746"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.441855"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1188
-  (0.1ms) RELEASE SAVEPOINT active_record_1
405
+ Processing by S3Relay::UploadsController#create as HTML
406
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"df927d35-a844-4712-8444-438d2058da38", "filename"=>"cat.png", "content_type"=>"image/png"}
1189
407
   (0.1ms) SAVEPOINT active_record_1
1190
408
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1191
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
409
+ :value: df927d35-a844-4712-8444-438d2058da38
1192
410
  :format: 1
1193
411
  ' LIMIT 1
1194
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.445236"], ["filename", "cat.png"], ["parent_id", 2], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.443662"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.445236"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
412
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.902055"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.900650"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.902055"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1195
413
   (0.1ms) RELEASE SAVEPOINT active_record_1
1196
- 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
414
+ Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
415
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1197
416
   (0.1ms) ROLLBACK
1198
417
   (0.1ms) BEGIN
1199
- -----------------------------------------------
1200
- S3Relay::Upload::#pending?: test_0001_anonymous
1201
- -----------------------------------------------
418
+ -----------------------------------------------------------------------
419
+ S3Relay::Upload::validations::upload_type: test_0001_validates presence
420
+ -----------------------------------------------------------------------
421
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
422
+  (0.1ms) ROLLBACK
423
+  (0.1ms) BEGIN
424
+ ----------------------------------------------------------------
425
+ S3Relay::Upload::validations::uuid: test_0001_validates presence
426
+ ----------------------------------------------------------------
427
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1202
428
   (0.1ms) ROLLBACK
1203
429
   (0.1ms) BEGIN
1204
-  (0.1ms) COMMIT
1205
-  (0.1ms) BEGIN
430
+ ------------------------------------------------------------------
431
+ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
432
+ ------------------------------------------------------------------
1206
433
   (0.1ms) SAVEPOINT active_record_1
1207
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.454415"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.454415"]]
1208
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1209
-  (0.1ms) SAVEPOINT active_record_1
1210
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1211
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
1212
- :format: 1
1213
- ' LIMIT 1
1214
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.457570"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.455878"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.457570"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
1215
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1216
-  (0.1ms) SAVEPOINT active_record_1
1217
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1218
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
1219
- :format: 1
1220
- ' LIMIT 1
1221
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.460805"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.459175"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.460805"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1222
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1223
-  (0.1ms) SAVEPOINT active_record_1
1224
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1225
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
1226
- :format: 1
1227
- ' LIMIT 1
1228
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.463621"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.462331"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.463621"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
434
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.914403"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.914115"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.914403"]]
1229
435
   (0.1ms) RELEASE SAVEPOINT active_record_1
1230
-  (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'
1231
-  (0.2ms) ROLLBACK
436
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
437
+  (0.1ms) ROLLBACK
1232
438
   (0.1ms) BEGIN
1233
439
  -------------------------------------------------------
1234
440
  S3Relay::Upload::upon finalization: test_0001_anonymous
1235
441
  -------------------------------------------------------
1236
442
   (0.1ms) ROLLBACK
1237
443
   (0.1ms) BEGIN
444
+ ------------------------------------------------------
445
+ S3Relay::Upload::scopes::imported: test_0001_anonymous
446
+ ------------------------------------------------------
447
+  (0.1ms) SAVEPOINT active_record_1
448
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.921707"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.921407"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.921707"]]
449
+  (0.1ms) RELEASE SAVEPOINT active_record_1
450
+  (0.1ms) SAVEPOINT active_record_1
451
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.923295"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.923025"], ["state", "imported"], ["updated_at", "2016-12-30 06:50:36.923295"]]
452
+  (0.1ms) RELEASE SAVEPOINT active_record_1
453
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
454
+  (0.1ms) ROLLBACK
455
+  (0.1ms) BEGIN
456
+ -----------------------------------------------------
457
+ S3Relay::Upload::#mark_imported!: test_0001_anonymous
458
+ -----------------------------------------------------
459
+  (0.1ms) SAVEPOINT active_record_1
460
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
461
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
462
+  (0.1ms) ROLLBACK
463
+  (0.1ms) BEGIN
1238
464
   (0.1ms) COMMIT
1239
465
   (0.1ms) BEGIN
1240
466
   (0.1ms) SAVEPOINT active_record_1
1241
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.468578"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.468578"]]
467
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.932377"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.932377"]]
1242
468
   (0.1ms) RELEASE SAVEPOINT active_record_1
1243
469
   (0.1ms) SAVEPOINT active_record_1
1244
470
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1245
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
471
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
1246
472
  :format: 1
1247
473
  ' LIMIT 1
1248
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.470943"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:35:33.469673"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.470943"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
474
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.935135"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.933718"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.935135"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
1249
475
   (0.1ms) RELEASE SAVEPOINT active_record_1
1250
476
   (0.1ms) SAVEPOINT active_record_1
1251
477
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1252
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
478
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
1253
479
  :format: 1
1254
480
  ' LIMIT 1
1255
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.473517"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:35:33.472414"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.473517"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
481
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.937819"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.936573"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.937819"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1256
482
   (0.1ms) RELEASE SAVEPOINT active_record_1
1257
483
   (0.1ms) SAVEPOINT active_record_1
1258
484
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1259
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
485
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
1260
486
  :format: 1
1261
487
  ' LIMIT 1
1262
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.475884"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:35:33.474755"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.475884"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
488
+ SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.940505"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.939215"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.940505"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1263
489
   (0.1ms) RELEASE SAVEPOINT active_record_1
1264
- 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'
1265
- SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 4 WHERE "s3_relay_uploads"."uuid" IN ('0c3a7abe-8821-4e0b-a423-99a1c2fa2e57', '0c3a7abe-8821-4e0b-a423-99a1c2fa2e57') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
1266
- 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'
490
+ 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'
491
+ SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 5 WHERE "s3_relay_uploads"."uuid" IN ('b1b5b5e9-157f-415a-892d-1e0e84fcb336', 'b1b5b5e9-157f-415a-892d-1e0e84fcb336') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
492
+ 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'
1267
493
   (0.1ms) ROLLBACK
1268
-  (0.1ms) BEGIN
1269
- ----------------------------------------------------------------------
1270
- S3Relay::Upload::validations::pending_at: test_0001_validates presence
1271
- ----------------------------------------------------------------------
1272
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1273
-  (0.1ms) ROLLBACK
1274
-  (0.1ms) BEGIN
1275
- ----------------------------------------------------------------
1276
- S3Relay::Upload::validations::uuid: test_0001_validates presence
1277
- ----------------------------------------------------------------
1278
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
494
+  (0.2ms) BEGIN
495
+ -----------------------------------------------
496
+ S3Relay::Upload::#imported: test_0001_anonymous
497
+ -----------------------------------------------
1279
498
   (0.1ms) ROLLBACK
1280
499
   (0.1ms) BEGIN
1281
- ------------------------------------------------------------------
1282
- S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
1283
- ------------------------------------------------------------------
500
+ -----------------------------------------------------------------------------------------------------------------
501
+ S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
502
+ -----------------------------------------------------------------------------------------------------------------
1284
503
   (0.1ms) SAVEPOINT active_record_1
1285
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:35:33.494259"], ["pending_at", "2016-09-07 16:35:33.493873"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.494259"]]
504
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.949745"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.949745"]]
1286
505
   (0.1ms) RELEASE SAVEPOINT active_record_1
1287
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1288
-  (0.1ms) ROLLBACK
1289
-  (0.1ms) BEGIN
1290
- --------------------------------------------------
1291
- S3Relay::Upload::#private_url: test_0001_anonymous
1292
- --------------------------------------------------
1293
-  (0.1ms) ROLLBACK
1294
-  (0.1ms) BEGIN
1295
-  (0.1ms) COMMIT
1296
-  (0.1ms) BEGIN
506
+  (0.2ms) 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'
507
+ Processing by S3Relay::UploadsController#create as HTML
508
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"2b478a2e-e6e2-49f6-a226-e375fd58541f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"6"}
509
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 6 LIMIT 1
510
+  (0.1ms) SAVEPOINT active_record_1
511
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
512
+ :value: 2b478a2e-e6e2-49f6-a226-e375fd58541f
513
+ :format: 1
514
+ ' LIMIT 1
515
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.956132"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 6], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.954605"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.956132"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
516
+  (0.1ms) RELEASE SAVEPOINT active_record_1
517
+ Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)
518
+  (0.2ms) 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'
1297
519
   (0.1ms) ROLLBACK
1298
520
   (0.1ms) BEGIN
1299
521
  -----------------------------------------------------
1300
522
  S3Relay::Upload::scopes::pending: test_0001_anonymous
1301
523
  -----------------------------------------------------
1302
524
   (0.1ms) SAVEPOINT active_record_1
1303
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:35:33.504025"], ["pending_at", "2016-09-07 16:35:33.503768"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.504025"]]
525
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.961353"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.961050"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.961353"]]
1304
526
   (0.1ms) RELEASE SAVEPOINT active_record_1
1305
527
   (0.1ms) SAVEPOINT active_record_1
1306
- SQL (0.1ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:35:33.505527"], ["pending_at", "2016-09-07 16:35:33.505255"], ["state", "imported"], ["updated_at", "2016-09-07 16:35:33.505527"]]
528
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 06:50:36.962869"], ["data", "{}"], ["pending_at", "2016-12-30 06:50:36.962621"], ["state", "imported"], ["updated_at", "2016-12-30 06:50:36.962869"]]
1307
529
   (0.1ms) RELEASE SAVEPOINT active_record_1
1308
530
  S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'
1309
531
   (0.1ms) ROLLBACK
1310
532
   (0.1ms) BEGIN
1311
-  (0.1ms) COMMIT
1312
-  (0.1ms) BEGIN
1313
-  (0.1ms) ROLLBACK
1314
-  (0.1ms) BEGIN
1315
- -----------------------------------------------------------------------------------------------------------------
1316
- S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
1317
- -----------------------------------------------------------------------------------------------------------------
1318
-  (0.1ms) SAVEPOINT active_record_1
1319
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.514731"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.514731"]]
1320
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1321
-  (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'
1322
- Processing by S3Relay::UploadsController#create as HTML
1323
- Parameters: {"association"=>"photo_uploads", "uuid"=>"6df49f66-b480-4815-8593-c5f01772f657", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"}
1324
- Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 5 LIMIT 1
1325
-  (0.2ms) SAVEPOINT active_record_1
1326
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1327
- :value: 6df49f66-b480-4815-8593-c5f01772f657
1328
- :format: 1
1329
- ' LIMIT 1
1330
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.522707"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.519992"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.522707"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1331
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1332
- Completed 201 Created in 7ms (Views: 0.2ms | ActiveRecord: 1.1ms)
1333
-  (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'
1334
-  (0.1ms) ROLLBACK
1335
-  (0.1ms) BEGIN
1336
- ---------------------------------------------------------------------
1337
- S3Relay::UploadsController::POST create::success: test_0001_anonymous
1338
- ---------------------------------------------------------------------
1339
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1340
- Processing by S3Relay::UploadsController#create as HTML
1341
- Parameters: {"association"=>"photo_uploads", "uuid"=>"000a20e4-ed14-4254-b6a1-dd299691c292", "filename"=>"cat.png", "content_type"=>"image/png"}
1342
-  (0.1ms) SAVEPOINT active_record_1
1343
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1344
- :value: 000a20e4-ed14-4254-b6a1-dd299691c292
1345
- :format: 1
1346
- ' LIMIT 1
1347
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.533674"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:35:33.532364"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.533674"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1348
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1349
- Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
1350
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1351
-  (0.1ms) ROLLBACK
1352
-  (0.1ms) BEGIN
1353
- ----------------------------------------------------------
1354
- S3Relay::Upload::associations::parent: test_0001_anonymous
1355
- ----------------------------------------------------------
1356
-  (0.1ms) ROLLBACK
1357
-  (0.1ms) BEGIN
1358
533
  --------------------------------------------------------------------
1359
534
  S3Relay::Upload::validations::filename: test_0001_validates presence
1360
535
  --------------------------------------------------------------------
1361
536
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1362
537
   (0.1ms) ROLLBACK
1363
538
   (0.1ms) BEGIN
1364
- -------------------------------------------------------------------
1365
- S3Relay::UploadsController::POST create::error: test_0001_anonymous
1366
- -------------------------------------------------------------------
1367
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1368
- Processing by S3Relay::UploadsController#create as HTML
1369
- Parameters: {"uuid"=>"958b443a-ebd0-49cf-a23f-263dc9810bc3", "filename"=>"cat.png", "content_type"=>"image/png"}
1370
-  (0.1ms) SAVEPOINT active_record_1
1371
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1372
- :value: 958b443a-ebd0-49cf-a23f-263dc9810bc3
1373
- :format: 1
1374
- ' LIMIT 1
1375
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1376
- Completed 422 Unprocessable Entity in 2ms (Views: 0.1ms | ActiveRecord: 0.4ms)
1377
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1378
-  (0.1ms) ROLLBACK
1379
-  (0.1ms) BEGIN
1380
- ---------------------------------------------------------------------------------
1381
- S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
1382
- ---------------------------------------------------------------------------------
1383
-  (0.1ms) SAVEPOINT active_record_1
1384
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.552314"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.552314"]]
1385
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1386
-  (0.1ms) ROLLBACK
1387
-  (0.1ms) BEGIN
1388
539
   (0.1ms) COMMIT
1389
540
   (0.1ms) BEGIN
1390
541
   (0.1ms) ROLLBACK
@@ -1393,56 +544,71 @@ S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymou
1393
544
   (0.1ms) BEGIN
1394
545
   (0.1ms) ROLLBACK
1395
546
   (0.1ms) BEGIN
1396
- ------------------------------------------------------------------------------------------
1397
- S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
1398
- ------------------------------------------------------------------------------------------
1399
-  (0.2ms) SAVEPOINT active_record_1
1400
- SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.557755"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.557755"]]
1401
-  (0.1ms) RELEASE SAVEPOINT active_record_1
547
+ ---------------------------------------------------------------------------------------------------------------------
548
+ S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
549
+ ---------------------------------------------------------------------------------------------------------------------
550
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
551
+ Processing by S3Relay::UploadsController#create as HTML
552
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"58cd1837-8d87-4dca-ae7e-c612080d5380", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
553
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
554
+  (0.1ms) SAVEPOINT active_record_1
555
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
556
+ :value: 58cd1837-8d87-4dca-ae7e-c612080d5380
557
+ :format: 1
558
+ ' LIMIT 1
559
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.978191"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:36.976949"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.978191"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
560
+  (0.1ms) RELEASE SAVEPOINT active_record_1
561
+ Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.8ms)
562
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1402
563
   (0.1ms) ROLLBACK
1403
564
   (0.1ms) BEGIN
1404
- -----------------------------------------------------------------------------------
1405
- S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
1406
- -----------------------------------------------------------------------------------
1407
-  (0.1ms) SAVEPOINT active_record_1
1408
- SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-09-07 16:35:33.561051"], ["name", "Flux Capacitor"], ["updated_at", "2016-09-07 16:35:33.561051"]]
1409
-  (0.1ms) RELEASE SAVEPOINT active_record_1
565
+ --------------------------------------------------
566
+ S3Relay::Upload::#private_url: test_0001_anonymous
567
+ --------------------------------------------------
568
+  (0.1ms) ROLLBACK
569
+  (0.1ms) BEGIN
570
+ -------------------------------------------------------------------
571
+ S3Relay::UploadsController::POST create::error: test_0001_anonymous
572
+ -------------------------------------------------------------------
573
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
574
+ Processing by S3Relay::UploadsController#create as HTML
575
+ Parameters: {"uuid"=>"8fc5811d-89be-4a64-a33c-eddd4d328915", "filename"=>"cat.png", "content_type"=>"image/png"}
1410
576
   (0.1ms) SAVEPOINT active_record_1
1411
577
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1412
- :value: 0c3a7abe-8821-4e0b-a423-99a1c2fa2e57
578
+ :value: 8fc5811d-89be-4a64-a33c-eddd4d328915
1413
579
  :format: 1
1414
580
  ' LIMIT 1
1415
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-09-07 16:35:33.563692"], ["filename", "cat.png"], ["parent_id", 8], ["parent_type", "Product"], ["pending_at", "2016-09-07 16:35:33.560469"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.563692"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
1416
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1417
-  (0.1ms) ROLLBACK
581
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
582
+ Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.4ms)
583
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
584
+  (0.2ms) ROLLBACK
1418
585
   (0.1ms) BEGIN
1419
- ------------------------------------------------------
1420
- S3Relay::Upload::scopes::imported: test_0001_anonymous
1421
- ------------------------------------------------------
586
+ -----------------------------------------------------------------------------------
587
+ S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
588
+ -----------------------------------------------------------------------------------
1422
589
   (0.1ms) SAVEPOINT active_record_1
1423
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:35:33.566544"], ["pending_at", "2016-09-07 16:35:33.566261"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.566544"]]
590
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:36.995144"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:36.995144"]]
1424
591
   (0.1ms) RELEASE SAVEPOINT active_record_1
1425
592
   (0.1ms) SAVEPOINT active_record_1
1426
- SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2016-09-07 16:35:33.567892"], ["pending_at", "2016-09-07 16:35:33.567623"], ["state", "imported"], ["updated_at", "2016-09-07 16:35:33.567892"]]
1427
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1428
- S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
593
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
594
+ :value: b1b5b5e9-157f-415a-892d-1e0e84fcb336
595
+ :format: 1
596
+ ' LIMIT 1
597
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:36.997828"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 7], ["parent_type", "Product"], ["pending_at", "2016-12-30 06:50:36.994468"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:36.997828"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
598
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1429
599
   (0.1ms) ROLLBACK
1430
600
   (0.1ms) BEGIN
1431
- -----------------------------------------------
1432
- S3Relay::Upload::#imported: test_0001_anonymous
1433
- -----------------------------------------------
601
+ ----------------------------------------------------------
602
+ S3Relay::Upload::associations::parent: test_0001_anonymous
603
+ ----------------------------------------------------------
1434
604
   (0.1ms) ROLLBACK
1435
605
   (0.1ms) BEGIN
1436
- -----------------------------------------------------
1437
- S3Relay::Upload::#mark_imported!: test_0001_anonymous
1438
- -----------------------------------------------------
606
+ ------------------------------------------------------------------------------------------
607
+ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
608
+ ------------------------------------------------------------------------------------------
1439
609
   (0.1ms) SAVEPOINT active_record_1
1440
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1441
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1442
-  (0.1ms) ROLLBACK
1443
-  (0.1ms) BEGIN
1444
-  (0.1ms) COMMIT
1445
-  (0.1ms) BEGIN
610
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 06:50:37.005434"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 06:50:37.005434"]]
611
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1446
612
   (0.1ms) ROLLBACK
1447
613
   (0.1ms) BEGIN
1448
614
  ------------------------------------------------------------------------
@@ -1451,43 +617,27 @@ S3Relay::Upload::validations::content_type: test_0001_validates presence
1451
617
  S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
1452
618
   (0.1ms) ROLLBACK
1453
619
   (0.1ms) BEGIN
1454
- ---------------------------------------------------------------------------------------------------------------------
1455
- S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
1456
- ---------------------------------------------------------------------------------------------------------------------
1457
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1458
- Processing by S3Relay::UploadsController#create as HTML
1459
- Parameters: {"association"=>"photo_uploads", "uuid"=>"0d4facb1-717b-45cc-b423-a4d79c931a0c", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
1460
- Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
1461
-  (0.1ms) SAVEPOINT active_record_1
1462
- S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1463
- :value: 0d4facb1-717b-45cc-b423-a4d79c931a0c
1464
- :format: 1
1465
- ' LIMIT 1
1466
- 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", "2016-09-07 16:35:33.587219"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:35:33.585031"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.587219"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
1467
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1468
- Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.1ms)
1469
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1470
-  (0.1ms) ROLLBACK
1471
-  (0.1ms) BEGIN
620
+  (0.1ms) COMMIT
621
+  (0.1ms) BEGIN
622
+  (0.1ms) ROLLBACK
623
+  (0.1ms) BEGIN
624
+  (0.1ms) COMMIT
625
+  (0.1ms) BEGIN
626
+  (0.1ms) ROLLBACK
627
+  (0.1ms) BEGIN
1472
628
  --------------------------------------------------------------------------------------------------------------------------------------------
1473
629
  S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
1474
630
  --------------------------------------------------------------------------------------------------------------------------------------------
1475
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
631
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1476
632
  Processing by S3Relay::UploadsController#create as HTML
1477
- Parameters: {"association"=>"photo_uploads", "uuid"=>"6544b507-91fc-4418-ad95-aecda6a72b5b", "filename"=>"cat.png", "content_type"=>"image/png"}
1478
-  (0.1ms) SAVEPOINT active_record_1
1479
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
1480
- :value: 6544b507-91fc-4418-ad95-aecda6a72b5b
633
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"ba73948c-98f3-4e82-baa4-ec8654cd4439", "filename"=>"cat.png", "content_type"=>"image/png"}
634
+  (0.1ms) SAVEPOINT active_record_1
635
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
636
+ :value: ba73948c-98f3-4e82-baa4-ec8654cd4439
1481
637
  :format: 1
1482
- ' LIMIT 1
1483
- 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", "2016-09-07 16:35:33.598839"], ["filename", "cat.png"], ["pending_at", "2016-09-07 16:35:33.597471"], ["state", "pending"], ["updated_at", "2016-09-07 16:35:33.598839"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
1484
-  (0.1ms) RELEASE SAVEPOINT active_record_1
638
+ ' LIMIT 1
639
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 06:50:37.021286"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 06:50:37.019924"], ["state", "pending"], ["updated_at", "2016-12-30 06:50:37.021286"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
640
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1485
641
  Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
1486
-  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1487
-  (0.1ms) ROLLBACK
1488
-  (0.1ms) BEGIN
1489
- -----------------------------------------------------------------------
1490
- S3Relay::Upload::validations::upload_type: test_0001_validates presence
1491
- -----------------------------------------------------------------------
1492
- S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
642
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
1493
643
   (0.1ms) ROLLBACK