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: 42cd747cb8c3c662f14627be3d808760f354be5cfaa70b4559b830741ca8aa24
4
- data.tar.gz: 18e2bcc68d979fd3026a852457e13b72ad29484e75d3932df669f655059833cd
3
+ metadata.gz: 44b8d74056757f369bc5dc2f5f5ec51eee4d71c423a973b9e03e952a2ba44999
4
+ data.tar.gz: c6bf9d975ae8906af7cd6f179db34ab48f0747550874268b24c13bb6b6b63627
5
5
  SHA512:
6
- metadata.gz: ac60eed8aa944ba409c83a82ed7392542a533bc4191c875728e52b8a0e4ed72e2e92642ce4852edf94374e4237d963d674e15c29536ba268856b4e56b6726ed4
7
- data.tar.gz: a9b836f8d92cd8df70d93ec9fd3f6f5603777b308b1bde5124f46195d46dd3065604b8281b5e72203cbddfeae2c8f39744bc18eef2806ea04584e66981104d26
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}/#{uuid}.#{extension}"),
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 uuid
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: 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.1'
2
+ VERSION = '0.7.5'
3
3
  RUBY_VERSION = '2.7.3'
4
4
  RAILS_VERSION = '6.1.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobile_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith