activestorage-delayed 0.3.1 → 0.3.3

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: e3a8aa804d991375a89011a3001a4329eb2510f151690ec92f01c1b18d1cf9a6
4
- data.tar.gz: 51fb74d4c3449071aa9b94af9a61f2d17b619a5114d334cd878860cb9e2492f6
3
+ metadata.gz: '0039f175e4f3348c3a168c81529baab2cd200eb75bbf69e7470d73d05d1c3336'
4
+ data.tar.gz: 972e99f9f1a92ad432abfbf950b45f1f14542b0b9fbfadfe979038da40fd92e2
5
5
  SHA512:
6
- metadata.gz: 38a995e047e1b344d62325293abfd29f8d23ddd299adcd8235044aa5556b5fb3454d03351eb29b1834bd348bc57be607831b616d3efbbba1e72e0fc72a89d706
7
- data.tar.gz: cf66e127b9123bf19c56899c67a5b3f04cd97fdc77b05f2175e1f2f2e46d94ca1334b3e552b937a64c9e180f598b2fd95717c4fe788506ee01db7434b10ce727
6
+ metadata.gz: b2c43d55f3eb96fc53b14d5c60d25b1b7cd600181a359b5d32e0b25366bba7e6e738398cc6f44f4e089c328d05a4b53d19d96479a58dfc795d1f52bb33a1156c
7
+ data.tar.gz: 470a6b3ed0cc27e7a86efb5678644e919b8c0118c2c81cd7b678b485b9d0551852dd4480b85bb82f1e14bcd6482121aaa96b027ebf974c838461c42c165e3447
@@ -13,4 +13,4 @@ jobs:
13
13
  prepare_db_cmd: null
14
14
  copy_env: false
15
15
  run_rubocop: true
16
- rspec_cmd: 'bundle install and bundle exec rspec'
16
+ rspec_cmd: 'bundle install && bundle exec rspec'
@@ -12,23 +12,10 @@
12
12
  </content>
13
13
  <orderEntry type="jdk" jdkName="Remote: ruby-3.1.1-p18" jdkType="RUBY_SDK" />
14
14
  <orderEntry type="sourceFolder" forTests="false" />
15
- <orderEntry type="library" scope="PROVIDED" name="actioncable (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="actionmailbox (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="actionmailer (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="actionpack (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="actiontext (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="actionview (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="activejob (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="activemodel (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="activerecord (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="activestorage (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="activesupport (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
26
15
  <orderEntry type="library" scope="PROVIDED" name="addressable (v2.8.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
27
16
  <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, Remote: ruby-3.1.1-p18) [gem]" level="application" />
28
17
  <orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, Remote: ruby-3.1.1-p18) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="byebug (v11.1.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
30
18
  <orderEntry type="library" scope="PROVIDED" name="capybara (v3.36.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.10, Remote: ruby-3.1.1-p18) [gem]" level="application" />
32
19
  <orderEntry type="library" scope="PROVIDED" name="crass (v1.0.6, Remote: ruby-3.1.1-p18) [gem]" level="application" />
33
20
  <orderEntry type="library" scope="PROVIDED" name="database_cleaner-active_record (v2.0.1, Remote: ruby-3.1.1-p18) [gem]" level="application" />
34
21
  <orderEntry type="library" scope="PROVIDED" name="database_cleaner-core (v2.0.1, Remote: ruby-3.1.1-p18) [gem]" level="application" />
@@ -37,7 +24,6 @@
37
24
  <orderEntry type="library" scope="PROVIDED" name="erubi (v1.10.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
38
25
  <orderEntry type="library" scope="PROVIDED" name="factory_bot_rails (v6.2.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
39
26
  <orderEntry type="library" scope="PROVIDED" name="globalid (v1.0.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
40
- <orderEntry type="library" scope="PROVIDED" name="i18n (v1.10.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
41
27
  <orderEntry type="library" scope="PROVIDED" name="mail (v2.7.1, Remote: ruby-3.1.1-p18) [gem]" level="application" />
42
28
  <orderEntry type="library" scope="PROVIDED" name="marcel (v1.0.2, Remote: ruby-3.1.1-p18) [gem]" level="application" />
43
29
  <orderEntry type="library" scope="PROVIDED" name="matrix (v0.4.2, Remote: ruby-3.1.1-p18) [gem]" level="application" />
@@ -48,13 +34,12 @@
48
34
  <orderEntry type="library" scope="PROVIDED" name="net-pop (v0.1.1, Remote: ruby-3.1.1-p18) [gem]" level="application" />
49
35
  <orderEntry type="library" scope="PROVIDED" name="net-smtp (v0.3.1, Remote: ruby-3.1.1-p18) [gem]" level="application" />
50
36
  <orderEntry type="library" scope="PROVIDED" name="nio4r (v2.5.8, Remote: ruby-3.1.1-p18) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, Remote: ruby-3.1.1-p18) [gem]" level="application" />
51
38
  <orderEntry type="library" scope="PROVIDED" name="racc (v1.6.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
52
39
  <orderEntry type="library" scope="PROVIDED" name="rack (v2.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
53
40
  <orderEntry type="library" scope="PROVIDED" name="rack-test (v1.1.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
54
- <orderEntry type="library" scope="PROVIDED" name="rails (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
55
41
  <orderEntry type="library" scope="PROVIDED" name="rails-dom-testing (v2.0.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
56
42
  <orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.4.2, Remote: ruby-3.1.1-p18) [gem]" level="application" />
57
- <orderEntry type="library" scope="PROVIDED" name="railties (v7.0.2.3, Remote: ruby-3.1.1-p18) [gem]" level="application" />
58
43
  <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, Remote: ruby-3.1.1-p18) [gem]" level="application" />
59
44
  <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, Remote: ruby-3.1.1-p18) [gem]" level="application" />
60
45
  <orderEntry type="library" scope="PROVIDED" name="rbs (v2.1.0, Remote: ruby-3.1.1-p18) [gem]" level="application" />
@@ -37,7 +37,7 @@ module ActivestorageDelayed
37
37
  name = File.basename(filename, '.*').parameterize
38
38
  is_multiple = send(attr_name).class.name.include?('Many')
39
39
  name = "#{SecureRandom.uuid}-#{name}" if is_multiple
40
- "#{send(:id)}-#{name}#{File.extname(filename)}"
40
+ "#{send(:id)}-#{name}-#{Time.current.to_i}#{File.extname(filename)}"
41
41
  end
42
42
 
43
43
  # @param _file_data [Hash<'filename'>]
@@ -28,14 +28,15 @@ module ActivestorageDelayed
28
28
  file_data['io'] = io
29
29
  model.send(attr_name).attach(file_data.transform_keys(&:to_sym))
30
30
  model.send("#{attr_name}_after_upload", file_data)
31
- rescue => e # rubocop:disable Style/RescueStandardError
32
- print_failure(e, file_data)
33
31
  end
32
+ rescue => e # rubocop:disable Style/RescueStandardError
33
+ print_failure(e, file_data)
34
34
  end
35
35
 
36
36
  def print_failure(error, file_data = {})
37
37
  details = "#{error.message}. #{error.backtrace[0..20]}"
38
- Rails.logger.error("***#{self.class.name} -> Failed uploading file (#{file_data['filename']}): #{details}")
38
+ key = "#{delayed_upload.id}-#{file_data['filename']}"
39
+ Rails.logger.error("***#{self.class.name} -> Failed uploading file (#{key}): #{details}")
39
40
  model.send("#{attr_name}_error_upload", error, file_data)
40
41
  end
41
42
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivestorageDelayed
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage-delayed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo Diaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-16 00:00:00.000000000 Z
11
+ date: 2022-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage