s3_relay 0.6.1 → 0.6.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
- SHA1:
3
- metadata.gz: 9835ff2f903d38dd10971bdfdc19272000a55c51
4
- data.tar.gz: db51d02093b92ecbbde911797b3b647101a9ea4f
2
+ SHA256:
3
+ metadata.gz: ac80b19d5558dd1a3295bef5db612c7c92700fa663a780b527fd61d8173e2ce6
4
+ data.tar.gz: 3c934826ab7fb3c303701b86c756c79bd9a11fbb424ff95d281865d4419ac60d
5
5
  SHA512:
6
- metadata.gz: 2ab6c66fa1a90e951e4e9b46d5feeebf9ecd4731c3e7c42419bb1789f7994bbb7559bd83d32c752796336fafa5452b7ac72221819b1047aca5f00f098e4af1c0
7
- data.tar.gz: dcdc68c8b9522dea195d09606a0c7925c98732ce2d163c0008c39db447c0a6e99a50dcf004e360201667f89a905d2f102302746b460c21348c5bb03644ff4549
6
+ metadata.gz: 4a9e0bdfeeb2389bece2b48ffc69b9a832ade32e89426c2f1ae9308b38224e6709aac19ae2aad49c3ba74fe9e5dba5c49ac2071eac3989e195a188778c3c562b
7
+ data.tar.gz: e0b41b0462dd2794dc2217a4f6dd97caa5ae267988db7061904527ff4ef195dbea93a41f45050afb99ae7c40c858a57dde6b12f67ccbcd973c8b71468bf84cc5
data/README.md CHANGED
@@ -9,7 +9,7 @@ your Rails app to asynchronously ingest the files.
9
9
  ## Overview
10
10
 
11
11
  This Rails engine allows you to quickly implement direct uploads to Amazon S3
12
- from your Rails 3.1+ / 4.x application. It does not depend on any specific file
12
+ from your Ruby on Rails application. It does not depend on any specific file
13
13
  upload libraries, UI frameworks or AWS gems, like other solutions tend to.
14
14
 
15
15
  It works by utilizing Amazon S3's
@@ -1,4 +1,4 @@
1
- class CreateS3RelayUploads < ActiveRecord::Migration
1
+ class CreateS3RelayUploads < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :s3_relay_uploads do |t|
4
4
  t.binary :uuid, length: 16
@@ -1,3 +1,3 @@
1
1
  module S3Relay
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -0,0 +1,11 @@
1
+  (24.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
2
+  (3.7ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
3
+  (12.0ms) SELECT pg_try_advisory_lock(5724499521023098410);
4
+  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
5
+ Migrating to CreateS3RelayUploads (20141009000804)
6
+  (0.1ms) BEGIN
7
+  (5.9ms) CREATE TABLE "s3_relay_uploads" ("id" serial NOT NULL 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)
8
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20141009000804"]]
9
+  (0.5ms) COMMIT
10
+ Migrating to CreateProducts (20141021002149)
11
+  (0.4ms) SELECT pg_advisory_unlock(5724499521023098410)
@@ -0,0 +1,318 @@
1
+  (3.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2
+  (0.2ms) BEGIN
3
+  (2.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL
4
+  (0.2ms) COMMIT
5
+  (8.3ms)  SELECT schemaname || '.' || tablename
6
+ FROM pg_tables
7
+ WHERE
8
+ tablename !~ '_prt_' AND
9
+ tablename <> 'schema_migrations' AND tablename <> 'ar_internal_metadata' AND
10
+ schemaname = ANY (current_schemas(false))
11
+ 
12
+  (7.2ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
13
+  (13.3ms) TRUNCATE TABLE "public"."s3_relay_uploads", "public"."products" RESTART IDENTITY CASCADE;
14
+  (0.4ms) BEGIN
15
+  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL
16
+  (0.2ms) COMMIT
17
+  (0.2ms) BEGIN
18
+ -----------------------------------------------------------------------------
19
+ S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
20
+ -----------------------------------------------------------------------------
21
+  (0.2ms) SAVEPOINT active_record_1
22
+ SQL (0.8ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:13.872348"], ["updated_at", "2018-03-24 06:53:13.872348"]]
23
+  (0.1ms) RELEASE SAVEPOINT active_record_1
24
+  (0.2ms) ROLLBACK
25
+  (0.1ms) BEGIN
26
+ -----------------------------------------------------------------------
27
+ S3Relay::Upload::validations::upload_type: test_0001_validates presence
28
+ -----------------------------------------------------------------------
29
+ S3Relay::Upload Exists (2.0ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
30
+  (0.2ms) ROLLBACK
31
+  (0.1ms) BEGIN
32
+ --------------------------------------------------------
33
+ S3Relay::UploadsController::GET new: test_0001_anonymous
34
+ --------------------------------------------------------
35
+ Started GET "/s3_relay/uploads/new" for 127.0.0.1 at 2018-03-23 23:53:13 -0700
36
+ Processing by S3Relay::UploadsController#new as HTML
37
+ Completed 200 OK in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms)
38
+  (0.2ms) ROLLBACK
39
+  (0.1ms) BEGIN
40
+ ---------------------------------------------------------------------
41
+ S3Relay::UploadsController::POST create::success: test_0001_anonymous
42
+ ---------------------------------------------------------------------
43
+  (2.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
44
+ Started POST "/s3_relay/uploads" for 127.0.0.1 at 2018-03-23 23:53:13 -0700
45
+ Processing by S3Relay::UploadsController#create as HTML
46
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"1f6ce8d0-6d72-4dfa-a381-a20c83adf3aa", "filename"=>"cat.png", "content_type"=>"image/png"}
47
+  (0.2ms) SAVEPOINT active_record_1
48
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
49
+ SQL (0.5ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.929185"], ["created_at", "2018-03-24 06:53:13.930616"], ["updated_at", "2018-03-24 06:53:13.930616"]]
50
+  (0.2ms) RELEASE SAVEPOINT active_record_1
51
+ Completed 201 Created in 9ms (Views: 0.3ms | ActiveRecord: 1.1ms)
52
+  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
53
+  (0.2ms) ROLLBACK
54
+  (0.1ms) BEGIN
55
+ ---------------------------------------------------------------------------------------------------------------------
56
+ S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
57
+ ---------------------------------------------------------------------------------------------------------------------
58
+  (0.4ms) SELECT COUNT(*) FROM "s3_relay_uploads"
59
+ Started POST "/s3_relay/uploads" for 127.0.0.1 at 2018-03-23 23:53:13 -0700
60
+ Processing by S3Relay::UploadsController#create as HTML
61
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"e86fa017-8cda-44c5-8687-b2f491eaae4d", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
62
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT $2 [["id", 10000000], ["LIMIT", 1]]
63
+  (0.1ms) SAVEPOINT active_record_1
64
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
65
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.947929"], ["created_at", "2018-03-24 06:53:13.949036"], ["updated_at", "2018-03-24 06:53:13.949036"]]
66
+  (0.1ms) RELEASE SAVEPOINT active_record_1
67
+ Completed 201 Created in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)
68
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
69
+  (0.2ms) ROLLBACK
70
+  (0.1ms) BEGIN
71
+ ---------------------------------------------------------------------------------
72
+ S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
73
+ ---------------------------------------------------------------------------------
74
+  (0.1ms) SAVEPOINT active_record_1
75
+ SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:13.954452"], ["updated_at", "2018-03-24 06:53:13.954452"]]
76
+  (0.1ms) RELEASE SAVEPOINT active_record_1
77
+  (0.1ms) ROLLBACK
78
+  (0.1ms) BEGIN
79
+  (0.1ms) COMMIT
80
+  (0.3ms) BEGIN
81
+  (0.1ms) SAVEPOINT active_record_1
82
+ SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:13.958313"], ["updated_at", "2018-03-24 06:53:13.958313"]]
83
+  (0.1ms) RELEASE SAVEPOINT active_record_1
84
+  (0.1ms) SAVEPOINT active_record_1
85
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
86
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "IconUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.959871"], ["created_at", "2018-03-24 06:53:13.961095"], ["updated_at", "2018-03-24 06:53:13.961095"]]
87
+  (0.1ms) RELEASE SAVEPOINT active_record_1
88
+  (0.1ms) SAVEPOINT active_record_1
89
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
90
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.962684"], ["created_at", "2018-03-24 06:53:13.963725"], ["updated_at", "2018-03-24 06:53:13.963725"]]
91
+  (0.1ms) RELEASE SAVEPOINT active_record_1
92
+  (0.1ms) SAVEPOINT active_record_1
93
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
94
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.965102"], ["created_at", "2018-03-24 06:53:13.966147"], ["updated_at", "2018-03-24 06:53:13.966147"]]
95
+  (0.1ms) RELEASE SAVEPOINT active_record_1
96
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = $1 AND "s3_relay_uploads"."parent_id" = $2 AND "s3_relay_uploads"."upload_type" = $3 [["parent_type", "Product"], ["parent_id", 3], ["upload_type", "PhotoUpload"]]
97
+ SQL (0.7ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 3 WHERE "s3_relay_uploads"."uuid" IN ('\x66366136333930392d306233612d343863332d393462612d366466393638313331643737', '\x33396331333861322d326333382d346230352d616165302d343732643438343463353234') AND "s3_relay_uploads"."upload_type" = $1 [["upload_type", "PhotoUpload"]]
98
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = $1 AND "s3_relay_uploads"."parent_id" = $2 AND "s3_relay_uploads"."upload_type" = $3 [["parent_type", "Product"], ["parent_id", 3], ["upload_type", "PhotoUpload"]]
99
+  (0.2ms) ROLLBACK
100
+  (0.1ms) BEGIN
101
+  (0.1ms) COMMIT
102
+  (0.1ms) BEGIN
103
+  (0.1ms) SAVEPOINT active_record_1
104
+ SQL (0.7ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:13.973690"], ["updated_at", "2018-03-24 06:53:13.973690"]]
105
+  (0.4ms) RELEASE SAVEPOINT active_record_1
106
+  (0.4ms) SAVEPOINT active_record_1
107
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
108
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 4], ["upload_type", "IconUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.977086"], ["created_at", "2018-03-24 06:53:13.979153"], ["updated_at", "2018-03-24 06:53:13.979153"]]
109
+  (0.1ms) RELEASE SAVEPOINT active_record_1
110
+  (0.1ms) SAVEPOINT active_record_1
111
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
112
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 4], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.981069"], ["created_at", "2018-03-24 06:53:13.982191"], ["updated_at", "2018-03-24 06:53:13.982191"]]
113
+  (0.1ms) RELEASE SAVEPOINT active_record_1
114
+  (0.1ms) SAVEPOINT active_record_1
115
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
116
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 4], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.983737"], ["created_at", "2018-03-24 06:53:13.984834"], ["updated_at", "2018-03-24 06:53:13.984834"]]
117
+  (0.1ms) RELEASE SAVEPOINT active_record_1
118
+  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = $1 AND "s3_relay_uploads"."parent_id" = $2 AND "s3_relay_uploads"."upload_type" = $3 [["parent_type", "Product"], ["parent_id", 4], ["upload_type", "PhotoUpload"]]
119
+  (0.1ms) ROLLBACK
120
+  (0.1ms) BEGIN
121
+ -----------------------------------------------------------------------------------------------------------------
122
+ S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
123
+ -----------------------------------------------------------------------------------------------------------------
124
+  (0.3ms) SAVEPOINT active_record_1
125
+ SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:13.991825"], ["updated_at", "2018-03-24 06:53:13.991825"]]
126
+  (0.1ms) RELEASE SAVEPOINT active_record_1
127
+  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = $1 AND "s3_relay_uploads"."parent_id" = $2 AND "s3_relay_uploads"."upload_type" = $3 [["parent_type", "Product"], ["parent_id", 5], ["upload_type", "PhotoUpload"]]
128
+ Started POST "/s3_relay/uploads" for 127.0.0.1 at 2018-03-23 23:53:13 -0700
129
+ Processing by S3Relay::UploadsController#create as HTML
130
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"19cb2022-8003-412a-b755-9bbb9a67e3e3", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"5"}
131
+ Product Load (0.5ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT $2 [["id", 5], ["LIMIT", 1]]
132
+  (0.1ms) SAVEPOINT active_record_1
133
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
134
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 5], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:13.997593"], ["created_at", "2018-03-24 06:53:13.998848"], ["updated_at", "2018-03-24 06:53:13.998848"]]
135
+  (0.1ms) RELEASE SAVEPOINT active_record_1
136
+ Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 1.2ms)
137
+  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = $1 AND "s3_relay_uploads"."parent_id" = $2 AND "s3_relay_uploads"."upload_type" = $3 [["parent_type", "Product"], ["parent_id", 5], ["upload_type", "PhotoUpload"]]
138
+  (0.2ms) ROLLBACK
139
+  (0.1ms) BEGIN
140
+ ----------------------------------------------------------
141
+ S3Relay::Upload::associations::parent: test_0001_anonymous
142
+ ----------------------------------------------------------
143
+  (0.1ms) ROLLBACK
144
+  (0.1ms) BEGIN
145
+ -------------------------------------------------------------------
146
+ S3Relay::UploadsController::POST create::error: test_0001_anonymous
147
+ -------------------------------------------------------------------
148
+  (0.7ms) SELECT COUNT(*) FROM "s3_relay_uploads"
149
+ Started POST "/s3_relay/uploads" for 127.0.0.1 at 2018-03-23 23:53:14 -0700
150
+ Processing by S3Relay::UploadsController#create as HTML
151
+ Parameters: {"uuid"=>"c91b893f-c1b7-4468-a497-c3fcb3513153", "filename"=>"cat.png", "content_type"=>"image/png"}
152
+  (0.2ms) SAVEPOINT active_record_1
153
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
154
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
155
+ Completed 422 Unprocessable Entity in 3ms (Views: 0.2ms | ActiveRecord: 0.6ms)
156
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
157
+  (0.2ms) ROLLBACK
158
+  (0.1ms) BEGIN
159
+ ------------------------------------------------------------------------
160
+ S3Relay::Upload::validations::content_type: test_0001_validates presence
161
+ ------------------------------------------------------------------------
162
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
163
+  (0.1ms) ROLLBACK
164
+  (0.1ms) BEGIN
165
+  (0.2ms) COMMIT
166
+  (0.1ms) BEGIN
167
+  (0.1ms) ROLLBACK
168
+  (0.2ms) BEGIN
169
+ -----------------------------------------------------
170
+ S3Relay::Upload::scopes::pending: test_0001_anonymous
171
+ -----------------------------------------------------
172
+  (0.4ms) SAVEPOINT active_record_1
173
+ SQL (0.9ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "FileUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.023458"], ["created_at", "2018-03-24 06:53:14.024473"], ["updated_at", "2018-03-24 06:53:14.024473"]]
174
+  (0.1ms) RELEASE SAVEPOINT active_record_1
175
+  (0.1ms) SAVEPOINT active_record_1
176
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["state", "imported"], ["pending_at", "2018-03-24 06:53:14.027543"], ["created_at", "2018-03-24 06:53:14.027932"], ["updated_at", "2018-03-24 06:53:14.027932"]]
177
+  (0.1ms) RELEASE SAVEPOINT active_record_1
178
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = $1 [["state", "pending"]]
179
+  (0.1ms) ROLLBACK
180
+  (0.1ms) BEGIN
181
+ -----------------------------------------------
182
+ S3Relay::Upload::#pending?: test_0001_anonymous
183
+ -----------------------------------------------
184
+  (0.1ms) ROLLBACK
185
+  (0.1ms) BEGIN
186
+ --------------------------------------------------------------------
187
+ S3Relay::Upload::validations::filename: test_0001_validates presence
188
+ --------------------------------------------------------------------
189
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
190
+  (0.1ms) ROLLBACK
191
+  (0.1ms) BEGIN
192
+ -----------------------------------------------------
193
+ S3Relay::Upload::#mark_imported!: test_0001_anonymous
194
+ -----------------------------------------------------
195
+  (0.1ms) SAVEPOINT active_record_1
196
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
197
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
198
+  (0.1ms) ROLLBACK
199
+  (0.2ms) BEGIN
200
+ -------------------------------------------------------
201
+ S3Relay::Upload::upon finalization: test_0001_anonymous
202
+ -------------------------------------------------------
203
+  (0.3ms) ROLLBACK
204
+  (0.1ms) BEGIN
205
+ ----------------------------------------------------------------------
206
+ S3Relay::Upload::validations::pending_at: test_0001_validates presence
207
+ ----------------------------------------------------------------------
208
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
209
+  (0.1ms) ROLLBACK
210
+  (0.1ms) BEGIN
211
+  (0.1ms) COMMIT
212
+  (0.1ms) BEGIN
213
+  (0.1ms) SAVEPOINT active_record_1
214
+ SQL (0.3ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:14.048484"], ["updated_at", "2018-03-24 06:53:14.048484"]]
215
+  (0.1ms) RELEASE SAVEPOINT active_record_1
216
+  (0.1ms) SAVEPOINT active_record_1
217
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
218
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 6], ["upload_type", "IconUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.050004"], ["created_at", "2018-03-24 06:53:14.051254"], ["updated_at", "2018-03-24 06:53:14.051254"]]
219
+  (0.1ms) RELEASE SAVEPOINT active_record_1
220
+  (0.1ms) SAVEPOINT active_record_1
221
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
222
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 6], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.052844"], ["created_at", "2018-03-24 06:53:14.054127"], ["updated_at", "2018-03-24 06:53:14.054127"]]
223
+  (0.1ms) RELEASE SAVEPOINT active_record_1
224
+  (0.3ms) SAVEPOINT active_record_1
225
+ S3Relay::Upload Exists (0.6ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
226
+ SQL (0.4ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 6], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.055864"], ["created_at", "2018-03-24 06:53:14.059255"], ["updated_at", "2018-03-24 06:53:14.059255"]]
227
+  (0.1ms) RELEASE SAVEPOINT active_record_1
228
+ S3Relay::Upload Load (0.5ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = $1 AND "s3_relay_uploads"."parent_id" = $2 AND "s3_relay_uploads"."upload_type" = $3 ORDER BY pending_at ASC LIMIT $4 [["parent_type", "Product"], ["parent_id", 6], ["upload_type", "IconUpload"], ["LIMIT", 1]]
229
+  (0.2ms) ROLLBACK
230
+  (0.1ms) BEGIN
231
+  (0.1ms) COMMIT
232
+  (0.3ms) BEGIN
233
+  (0.1ms) ROLLBACK
234
+  (0.1ms) BEGIN
235
+ -----------------------------------------------------------------------------------
236
+ S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
237
+ -----------------------------------------------------------------------------------
238
+  (0.1ms) SAVEPOINT active_record_1
239
+ SQL (0.2ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:14.066405"], ["updated_at", "2018-03-24 06:53:14.066405"]]
240
+  (0.1ms) RELEASE SAVEPOINT active_record_1
241
+  (0.1ms) SAVEPOINT active_record_1
242
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
243
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "parent_type", "parent_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["parent_type", "Product"], ["parent_id", 7], ["upload_type", "FileUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.065784"], ["created_at", "2018-03-24 06:53:14.069195"], ["updated_at", "2018-03-24 06:53:14.069195"]]
244
+  (0.1ms) RELEASE SAVEPOINT active_record_1
245
+  (0.1ms) ROLLBACK
246
+  (0.1ms) BEGIN
247
+  (0.1ms) COMMIT
248
+  (0.1ms) BEGIN
249
+  (0.3ms) ROLLBACK
250
+  (0.2ms) BEGIN
251
+  (0.1ms) COMMIT
252
+  (0.1ms) BEGIN
253
+  (0.2ms) ROLLBACK
254
+  (0.1ms) BEGIN
255
+  (0.1ms) COMMIT
256
+  (0.1ms) BEGIN
257
+  (0.1ms) ROLLBACK
258
+  (0.1ms) BEGIN
259
+ ------------------------------------------------------
260
+ S3Relay::Upload::scopes::imported: test_0001_anonymous
261
+ ------------------------------------------------------
262
+  (0.1ms) SAVEPOINT active_record_1
263
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "FileUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.083739"], ["created_at", "2018-03-24 06:53:14.084121"], ["updated_at", "2018-03-24 06:53:14.084121"]]
264
+  (0.1ms) RELEASE SAVEPOINT active_record_1
265
+  (0.1ms) SAVEPOINT active_record_1
266
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("uuid", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["state", "imported"], ["pending_at", "2018-03-24 06:53:14.085836"], ["created_at", "2018-03-24 06:53:14.086195"], ["updated_at", "2018-03-24 06:53:14.086195"]]
267
+  (0.1ms) RELEASE SAVEPOINT active_record_1
268
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = $1 [["state", "imported"]]
269
+  (0.1ms) ROLLBACK
270
+  (0.2ms) BEGIN
271
+ ------------------------------------------------------------------------------------------
272
+ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
273
+ ------------------------------------------------------------------------------------------
274
+  (0.2ms) SAVEPOINT active_record_1
275
+ SQL (0.4ms) INSERT INTO "products" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Flux Capacitor"], ["created_at", "2018-03-24 06:53:14.093182"], ["updated_at", "2018-03-24 06:53:14.093182"]]
276
+  (0.1ms) RELEASE SAVEPOINT active_record_1
277
+  (0.1ms) ROLLBACK
278
+  (0.1ms) BEGIN
279
+ --------------------------------------------------------------------------------------------------------------------------------------------
280
+ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
281
+ --------------------------------------------------------------------------------------------------------------------------------------------
282
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
283
+ Started POST "/s3_relay/uploads" for 127.0.0.1 at 2018-03-23 23:53:14 -0700
284
+ Processing by S3Relay::UploadsController#create as HTML
285
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"0130ee2b-7bb7-4508-af12-673a1c381a4f", "filename"=>"cat.png", "content_type"=>"image/png"}
286
+  (0.1ms) SAVEPOINT active_record_1
287
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
288
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "user_id", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["user_id", 123], ["upload_type", "PhotoUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.100563"], ["created_at", "2018-03-24 06:53:14.101740"], ["updated_at", "2018-03-24 06:53:14.101740"]]
289
+  (0.2ms) RELEASE SAVEPOINT active_record_1
290
+ Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.8ms)
291
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
292
+  (0.2ms) ROLLBACK
293
+  (0.2ms) BEGIN
294
+ ------------------------------------------------------------------
295
+ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
296
+ ------------------------------------------------------------------
297
+  (0.3ms) SAVEPOINT active_record_1
298
+ S3Relay::Upload Exists (0.3ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
299
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("uuid", "upload_type", "filename", "content_type", "state", "pending_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["uuid", "<36 bytes of binary data>"], ["upload_type", "FileUpload"], ["filename", "cat.png"], ["content_type", "image/png"], ["state", "pending"], ["pending_at", "2018-03-24 06:53:14.108647"], ["created_at", "2018-03-24 06:53:14.110646"], ["updated_at", "2018-03-24 06:53:14.110646"]]
300
+  (0.1ms) RELEASE SAVEPOINT active_record_1
301
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = $1 LIMIT $2 [["uuid", "<36 bytes of binary data>"], ["LIMIT", 1]]
302
+  (0.1ms) ROLLBACK
303
+  (0.1ms) BEGIN
304
+ ----------------------------------------------------------------
305
+ S3Relay::Upload::validations::uuid: test_0001_validates presence
306
+ ----------------------------------------------------------------
307
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT $1 [["LIMIT", 1]]
308
+  (0.1ms) ROLLBACK
309
+  (0.1ms) BEGIN
310
+ --------------------------------------------------
311
+ S3Relay::Upload::#private_url: test_0001_anonymous
312
+ --------------------------------------------------
313
+  (0.1ms) ROLLBACK
314
+  (0.1ms) BEGIN
315
+ -----------------------------------------------
316
+ S3Relay::Upload::#imported: test_0001_anonymous
317
+ -----------------------------------------------
318
+  (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.6.1
4
+ version: 0.6.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: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2018-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails
@@ -243,6 +243,8 @@ files:
243
243
  - test/dummy/db/migrate/20141021002149_create_products.rb
244
244
  - test/dummy/db/schema.rb
245
245
  - test/dummy/db/seeds.rb
246
+ - test/dummy/log/development.log
247
+ - test/dummy/log/test.log
246
248
  - test/dummy/package.json
247
249
  - test/dummy/public/404.html
248
250
  - test/dummy/public/422.html
@@ -282,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
284
  version: '0'
283
285
  requirements: []
284
286
  rubyforge_project:
285
- rubygems_version: 2.6.13
287
+ rubygems_version: 2.7.4
286
288
  signing_key:
287
289
  specification_version: 4
288
290
  summary: Direct uploads to S3 and ingestion by your Rails app.
@@ -346,6 +348,8 @@ test_files:
346
348
  - test/dummy/db/schema.rb
347
349
  - test/dummy/db/seeds.rb
348
350
  - test/dummy/db/migrate/20141021002149_create_products.rb
351
+ - test/dummy/log/test.log
352
+ - test/dummy/log/development.log
349
353
  - test/models/s3_relay/upload_test.rb
350
354
  - test/support/database_cleaner.rb
351
355
  - test/factories/uploads.rb