s3_relay 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a445da28fd8e607e840b5162997108f72b6991d
4
- data.tar.gz: 145e3b4a9b34deb5c12b1064e6831f0b4699f4c2
3
+ metadata.gz: dfa694688acdc03f3739afa1a34306a1e0df9bb7
4
+ data.tar.gz: 66b81f80265a47492da962115cc212d8a4d18c0d
5
5
  SHA512:
6
- metadata.gz: 67124c5eabb42d8312e690872def838b1328056f8ed1664c097c38df957c9defcce3a2f489e46c0e25c756d456e8c64eda34bc151e02b73e0edfc9b8476f1465
7
- data.tar.gz: ece811605d23c59d133168315b304f8b51bc192f1d4b34f4ff8c49be5a9e6886eb838fac7c435b74d7a51f70d860c42cb748f3ffe7580a893608979cd0326845
6
+ metadata.gz: 935aec666d163f9659b1d851bf64c58d456803ebb7eb6c42da34c108afa04ab20cd634e5ceb64d3f653bbd52656320b352bfca401101962e36fdd26aa74fe805
7
+ data.tar.gz: a323b155a06c29dfd165a7d98290b59d40bf728d8188542a653dd4cdefbf9a8d82583af8b2e1636957546d23dd09ad3bc726cc4a9748b72426131e7f91e227ae
@@ -37,7 +37,7 @@ module S3Relay
37
37
 
38
38
  association_method = "associate_#{attribute}"
39
39
 
40
- after_save association_method
40
+ after_save association_method.to_sym
41
41
 
42
42
  define_method association_method do
43
43
  new_uuids = send(virtual_attribute)
@@ -1,3 +1,3 @@
1
1
  module S3Relay
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -0,0 +1,388 @@
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
90
+ --------------------------------------------------
91
+ S3Relay::Upload::#private_url: test_0001_anonymous
92
+ --------------------------------------------------
93
+  (0.1ms) ROLLBACK
94
+  (0.1ms) BEGIN
95
+ -----------------------------------------------
96
+ S3Relay::Upload::#pending?: test_0001_anonymous
97
+ -----------------------------------------------
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
118
+ -----------------------------------------------------
119
+ S3Relay::Upload::scopes::pending: test_0001_anonymous
120
+ -----------------------------------------------------
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
129
+  (0.1ms) BEGIN
130
+  (0.1ms) COMMIT
131
+  (0.1ms) BEGIN
132
+  (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"]]
134
+  (0.1ms) RELEASE SAVEPOINT active_record_1
135
+  (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
138
+ :format: 1
139
+ ' 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>"]]
141
+  (0.1ms) RELEASE SAVEPOINT active_record_1
142
+  (0.1ms) SAVEPOINT active_record_1
143
+ 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
145
+ :format: 1
146
+ ' 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>"]]
148
+  (0.1ms) RELEASE SAVEPOINT active_record_1
149
+  (0.1ms) SAVEPOINT active_record_1
150
+ 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
152
+ :format: 1
153
+ ' 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>"]]
155
+  (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
159
+  (0.1ms) ROLLBACK
160
+  (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
+ -------------------------------------------------------
176
+  (0.1ms) ROLLBACK
177
+  (0.1ms) BEGIN
178
+ -----------------------------------------------
179
+ S3Relay::Upload::#imported: test_0001_anonymous
180
+ -----------------------------------------------
181
+  (0.1ms) ROLLBACK
182
+  (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
+ -----------------------------------------------------------------------------------------------------------------
197
+  (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>"]]
210
+  (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
+  (0.1ms) ROLLBACK
225
+  (0.1ms) BEGIN
226
+  (0.1ms) COMMIT
227
+  (0.0ms) BEGIN
228
+  (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"]]
230
+  (0.1ms) RELEASE SAVEPOINT active_record_1
231
+  (0.1ms) SAVEPOINT active_record_1
232
+ 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
234
+ :format: 1
235
+ ' 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>"]]
237
+  (0.1ms) RELEASE SAVEPOINT active_record_1
238
+  (0.1ms) SAVEPOINT active_record_1
239
+ 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
241
+ :format: 1
242
+ ' 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>"]]
244
+  (0.1ms) RELEASE SAVEPOINT active_record_1
245
+  (0.1ms) SAVEPOINT active_record_1
246
+ 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
248
+ :format: 1
249
+ ' 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>"]]
251
+  (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
253
+  (0.1ms) ROLLBACK
254
+  (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"
270
+  (0.1ms) ROLLBACK
271
+  (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
292
+  (0.1ms) ROLLBACK
293
+  (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
+ -----------------------------------------------------------------------------
315
+ S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
316
+ -----------------------------------------------------------------------------
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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_relay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenny Johnston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails
@@ -212,6 +212,7 @@ files:
212
212
  - test/dummy/config/secrets.yml
213
213
  - test/dummy/db/migrate/20141021002149_create_products.rb
214
214
  - test/dummy/db/schema.rb
215
+ - test/dummy/log/test.log
215
216
  - test/dummy/public/404.html
216
217
  - test/dummy/public/422.html
217
218
  - test/dummy/public/500.html
@@ -245,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
246
  version: '0'
246
247
  requirements: []
247
248
  rubyforge_project:
248
- rubygems_version: 2.4.3
249
+ rubygems_version: 2.5.1
249
250
  signing_key:
250
251
  specification_version: 4
251
252
  summary: Direct uploads to S3 and ingestion by your Rails app.
@@ -281,6 +282,7 @@ test_files:
281
282
  - test/dummy/config.ru
282
283
  - test/dummy/db/migrate/20141021002149_create_products.rb
283
284
  - test/dummy/db/schema.rb
285
+ - test/dummy/log/test.log
284
286
  - test/dummy/public/404.html
285
287
  - test/dummy/public/422.html
286
288
  - test/dummy/public/500.html