mobile_workflow 0.7.2 → 0.7.6

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: 4a72db383d64200fbddcb0c8f342efd48aa8ddb78ef6508d80fe5a0b15f76ac8
4
- data.tar.gz: d012d60e72823b8b44522d18fa714015fcdcc8ad4d177a6876f535af98a63788
3
+ metadata.gz: 0d2de8e8e58abbf48c61361f6e1f29743fb4503ea9903c2b8a262e1e8c5419f0
4
+ data.tar.gz: 7f4021ded5e08c6f4f1a66cc69556c47d6dc57b6f099c206dc9bdb3f892a7135
5
5
  SHA512:
6
- metadata.gz: '099e9983d4bcf1c6d3d1597ea2a100f37bed39479e9310db5ae3522004af62ee9632bf68696ed7719212c136da5ad5f6618c855ff7317fd501608c7e972e567e'
7
- data.tar.gz: fdc5298cb5bdee746c241a3fd5b114b34d2fb17a8234f7810d3cf0fc1c302ab9070817ff34814afc897994a4e9e700cec84e60decc0f5148c286ba7b43c9a986
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["binaries"]
7
+ return unless params[:binaries]
8
8
 
9
- params["binaries"].map do |binary|
10
- object_attribute = binary["identifier"]
11
- extension = binary["mimetype"].split('/')[1] # i.e. image/jpg --> jpg, video/mp4 --> mp4
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
- "identifier" => binary["identifier"],
15
- "url" => presigned_url("#{object.class.name.underscore}/#{object.id}/#{object_attribute}/#{s3_object_uuid}.#{extension}"),
16
- "method" => "PUT"
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: attachment_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: attachment_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: attachment_host)
154
+ Rails.application.routes.url_helpers.rails_blob_url(attachment, host: heroku_attachment_host)
155
155
  end
156
156
 
157
- def attachment_host
158
- "https://#{ENV.fetch('HEROKU_APP_NAME')}.herokuapp.com"
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
@@ -1,5 +1,5 @@
1
1
  module MobileWorkflow
2
- VERSION = '0.7.2'
2
+ VERSION = '0.7.6'
3
3
  RUBY_VERSION = '2.7.3'
4
4
  RAILS_VERSION = '6.1.3.1'
5
5
  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.2
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-01 00:00:00.000000000 Z
11
+ date: 2021-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails