active_storage_validations 0.8.4 → 0.8.5

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: e849b34d9f400b0fcd81c54a90cb8da3c9ba6dd6ac20299d4269779462af037d
4
- data.tar.gz: 69f0898b82531b842556e266fcd8c196194499754c3b99b699577f81f0e3ee0f
3
+ metadata.gz: 59fab644e926af1f0efdd86552c44adba1124fe1e268ae75aca5b3e7108d7862
4
+ data.tar.gz: 49d7f980a5e9c4b297254bdcd1bb6638fc0f8f9b48593c918a8fe44eb1953bff
5
5
  SHA512:
6
- metadata.gz: 2af49818e9cc542c738e7474ffab8f823553e47e64bb4f3e09da15b3cd1ecf852cabc566505428067701ef26fc5d91147366f7ef93b067b2873897736b0922b7
7
- data.tar.gz: '088e08c0f0847b27e49d262cc53be53124bda75d77541c0de42b20a6e3b57d074c2a30efd08921cbeb9b03f516af89b54988e4a6177dcfc013af5cf2e7b8174b'
6
+ metadata.gz: c7474e65d1cc5fbb3e55a394825729ac0e442aff438ab8b4fcb65ed47e27420fe07bb22e2bf1c60d12734c95d187f18c75372100ad43484a450479327316e4c1
7
+ data.tar.gz: aab2f32e8b2b21b105ca43d0f2684e90331ebbff8f2265ebeeed5f9751732b669062c69b532633258c5455c923339613bf021feb0bb7690e8b9eae3cdd8301e4
data/README.md CHANGED
@@ -237,6 +237,7 @@ You are welcome to contribute.
237
237
  - https://github.com/Atul9
238
238
  - https://github.com/victorbueno
239
239
  - https://github.com/UICJohn
240
+ - https://github.com/giovannibonetti
240
241
 
241
242
  ## License
242
243
 
@@ -26,7 +26,9 @@ module ActiveStorageValidations
26
26
  end
27
27
 
28
28
  def types_to_human_format
29
- types.join(', ')
29
+ types
30
+ .map { |type| type.to_s.split('/').last.upcase }
31
+ .join(', ')
30
32
  end
31
33
 
32
34
  def content_type(file)
@@ -13,7 +13,7 @@ module ActiveStorageValidations
13
13
  def validate_each(record, attribute, _)
14
14
  return true unless record.send(attribute).attached?
15
15
 
16
- files = Array.wrap(record.send(attribute))
16
+ files = Array.wrap(record.send(attribute)).compact.uniq
17
17
  errors_options = { min: options[:min], max: options[:max] }
18
18
 
19
19
  return true if files_count_valid?(files.count)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveStorageValidations
4
- VERSION = '0.8.4'
4
+ VERSION = '0.8.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_storage_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-30 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.0.2
141
+ rubygems_version: 3.0.6
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Validations for Active Storage