mobile_workflow 0.7.1 → 0.7.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44b8d74056757f369bc5dc2f5f5ec51eee4d71c423a973b9e03e952a2ba44999
|
4
|
+
data.tar.gz: c6bf9d975ae8906af7cd6f179db34ab48f0747550874268b24c13bb6b6b63627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d94380c62feba8c6a35ca2fbcf45fe64c68a6ab168d44dfbb7ee42aa8a984820025d5f1f99c34c548088cf4859f4fe8742b8e2bb5d08abc2de479522ba186ee
|
7
|
+
data.tar.gz: 185e20fa7caae0b0ca678394e6e7b78eb92acfd8d82af9422d95f3ebd5448202018a3b7b395d73855d56fc65f749c1b498a3e76d9689e7cec29e7813334c0b1c
|
@@ -12,14 +12,14 @@ module MobileWorkflow
|
|
12
12
|
|
13
13
|
{
|
14
14
|
"identifier" => binary["identifier"],
|
15
|
-
"url" => presigned_url("#{object.class.name.underscore}/#{object.id}/#{object_attribute}/#{
|
15
|
+
"url" => presigned_url("#{object.class.name.underscore}/#{object.id}/#{object_attribute}/#{s3_object_uuid}.#{extension}"),
|
16
16
|
"method" => "PUT"
|
17
17
|
}
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
22
|
-
def
|
22
|
+
def s3_object_uuid
|
23
23
|
SecureRandom.uuid
|
24
24
|
end
|
25
25
|
|
@@ -140,9 +140,9 @@ module MobileWorkflow
|
|
140
140
|
return nil unless attachment.attached?
|
141
141
|
|
142
142
|
if attachment.image?
|
143
|
-
Rails.application.routes.url_helpers.rails_representation_url(attachment.variant(options), host:
|
143
|
+
Rails.application.routes.url_helpers.rails_representation_url(attachment.variant(options), host: heroku_attachment_host)
|
144
144
|
elsif attachment.previewable?
|
145
|
-
Rails.application.routes.url_helpers.rails_representation_url(attachment.preview(options), host:
|
145
|
+
Rails.application.routes.url_helpers.rails_representation_url(attachment.preview(options), host: heroku_attachment_host)
|
146
146
|
else
|
147
147
|
return nil
|
148
148
|
end
|
@@ -151,11 +151,13 @@ module MobileWorkflow
|
|
151
151
|
def attachment_url(attachment)
|
152
152
|
return nil unless attachment.attached?
|
153
153
|
|
154
|
-
Rails.application.routes.url_helpers.rails_blob_url(attachment, host:
|
154
|
+
Rails.application.routes.url_helpers.rails_blob_url(attachment, host: heroku_attachment_host)
|
155
155
|
end
|
156
156
|
|
157
|
-
def
|
158
|
-
|
157
|
+
def heroku_attachment_host
|
158
|
+
# TODO: MBS - move this to a configuration property
|
159
|
+
app_name = Rails.env.test? ? 'test-app' : ENV.fetch('HEROKU_APP_NAME')
|
160
|
+
"https://#{app_name}.herokuapp.com"
|
159
161
|
end
|
160
162
|
end
|
161
163
|
end
|