custom_fields 2.12.0 → 2.12.1

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: a51660465e7fc7fcce0e0d68721fd629e3a7d970da166fda4166c964aa9c1c6a
4
- data.tar.gz: 3dec7501714fa700975e47dfc2989e78ad31e070ec47cf7a0c79f30e4b64bd1c
3
+ metadata.gz: 3357d5d55b5957c388cd463667d4469225b2b2c5fcd2070c352e24356376d1f0
4
+ data.tar.gz: 074afdf57443c539afc384e140f1c0203f57f719207439bc61cee08733d35947
5
5
  SHA512:
6
- metadata.gz: 29c47fa50966d7c86e8a1ab6b92240f630ac471b0fa4c0824b0e7c63cd161c0d0d94566735689b98acd453dbfccca8de2fc59244619f3dc0b34456c025bf6f7e
7
- data.tar.gz: ad06f66129e77dc3297256ba4645170040d408724deee848bc4cfbe119d4e52ab2e8a7aa11ad3e399544d2acfcfe7b6f0cd9defe90b44ab9729beb0f966e0154
6
+ metadata.gz: 3f7b9e7dc8dcb0a187ecbe36a05bfcce3a54911b94687beda218ee2b9c9274726eea8ea66598cf3f88cc5b143890f5d772ab9108a4ce90fbd8defd3ad35c8fb2
7
+ data.tar.gz: dc658cae3dd2628c9e43be55405e7a9c935623995e876976ca6ef751096d4a01604e44a29fdf778c7417f4d988d60f0aaf5a469cd2ea3cfa2477c7644b97e37d
@@ -50,7 +50,10 @@ module CustomFields
50
50
  klass.field rule['name'], localize: rule['localized'] || false, default: rule['default']
51
51
 
52
52
  klass.validates_presence_of rule['name'] if rule['required']
53
- klass.validates_uniqueness_of rule['name'], scope: :_type if rule['unique']
53
+
54
+ klass.validates_uniqueness_of rule['name'],
55
+ scope: :_type,
56
+ allow_blank: !rule['required'] if rule['unique']
54
57
  end
55
58
 
56
59
  # Build a hash storing the formatted (or not) values
@@ -1,5 +1,5 @@
1
1
  module CustomFields #:nodoc
2
2
 
3
- VERSION = '2.12.0'
3
+ VERSION = '2.12.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_fields
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-24 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubygems_version: 3.1.4
170
+ rubygems_version: 3.2.32
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Custom fields extension for Mongoid.