mongoid-enum-i18n 0.3.0 → 0.3.3

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
  SHA1:
3
- metadata.gz: 20a3fa80670c372248a986cedd1d50b37485d53d
4
- data.tar.gz: fcf103b1e0813ccdddefea25db09e757b6b26300
3
+ metadata.gz: 05a4d304aae8d23f8878a962cc00c64ddb1c7b3d
4
+ data.tar.gz: 64586879201fcec998fa0777c1ade4082cae546b
5
5
  SHA512:
6
- metadata.gz: 3fb70835354ec337221247d33c7e1c40869b7e1c80ab4aba4cc5b6850138f96ff3130a1d62aa7631400782ab65687b23710727658a9686cb12266038dd2e98bf
7
- data.tar.gz: 01485054ac63e0e5857c663827c6f2d1107daad93108e727a69b0244bce32fc36d33f7daf9d57f46a096651a37ee7e321abbd67d92d9e07c92a9d32e4056bfb8
6
+ metadata.gz: 96d4daf3bef66e8cd4932e586e01b06e3e871f1a0693a06feff4a773ffc7acce2f8b02884b3bb71f2148717fd06485ebc2651f4fcd790cb191008d05c0907bc9
7
+ data.tar.gz: c12600730ef0df5f45f9767035a31313fc93045affb8cfedbf4ac6a080efe2dbbf5a1c3d00e7546ba4dc65e9027ca2a35243eaa161e4a9b99e31047c92cc50c0
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in mongoid-enum.gemspec
4
- gem 'mongoid', '>= 5.0.0.rc0'
4
+ gem 'mongoid', '>= 5.0.0'
5
5
 
6
6
  gemspec
7
7
 
@@ -65,15 +65,16 @@ module Mongoid
65
65
  end
66
66
 
67
67
  def create_validations(field_name, values, options)
68
- if options[:multiple] && options[:validate]
68
+ return unless options[:validate]
69
+ if options[:multiple]
69
70
  validates field_name, :'mongoid/enum/validators/multiple' => {
70
71
  in: values.map(&:to_sym),
71
- allow_nil: !options[:required]
72
+ allow_blank: !options[:required]
72
73
  }
73
- elsif validate
74
+ else
74
75
  validates field_name,
75
76
  inclusion: { in: values },
76
- allow_nil: !options[:required]
77
+ allow_blank: !options[:required]
77
78
  end
78
79
  end
79
80
 
@@ -1,6 +1,6 @@
1
1
  module Mongoid
2
2
  # VERSION
3
3
  module Enum
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.3'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-enum-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Bruning
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-05 00:00:00.000000000 Z
12
+ date: 2015-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid