mobile_workflow 0.7.2 → 0.7.6
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d2de8e8e58abbf48c61361f6e1f29743fb4503ea9903c2b8a262e1e8c5419f0
|
4
|
+
data.tar.gz: 7f4021ded5e08c6f4f1a66cc69556c47d6dc57b6f099c206dc9bdb3f892a7135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 071d242cfba279223971ff929acaba7285e017b5c836be68ba5f02ad46a4571d39c98ea25de67d4b6ea586b4bdded534f6fae1cac27ebc53e3f8ba642ec01c33
|
7
|
+
data.tar.gz: 8d4ce06b17e4b3d4cd327c5d65f6035065e098456e39d10e420f287b5c545d8524899870c00bb893587ef4c4c72587e98193b8fdf78dde74671f32d0cf0d7083
|
@@ -4,16 +4,17 @@ module MobileWorkflow
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
def binary_urls(object)
|
7
|
-
return unless params[
|
7
|
+
return unless params[:binaries]
|
8
8
|
|
9
|
-
params[
|
10
|
-
|
11
|
-
|
9
|
+
params[:binaries].map do |binary|
|
10
|
+
identifier = binary[:identifier]
|
11
|
+
object_attribute = identifier.split(".")[0] # ensure extension doesnt get added here
|
12
|
+
extension = binary[:mimetype].split('/')[1] # i.e. image/jpg --> jpg, video/mp4 --> mp4
|
12
13
|
|
13
14
|
{
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
identifier: identifier,
|
16
|
+
url: presigned_url("#{object.class.name.underscore}/#{object.id}/#{object_attribute}/#{s3_object_uuid}.#{extension}"),
|
17
|
+
method: "PUT"
|
17
18
|
}
|
18
19
|
end
|
19
20
|
end
|
@@ -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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobile_workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|