validy 1.1.5.1 → 1.1.5.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/validy.rb +4 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6879285b4152539ec21a22301c44dde44677bd5bace7f9dbf2a06dc8b17dff9f
4
- data.tar.gz: 9894b76aef7cae5ed3d814227a6af9358cb66d83dd14cec4adeead016185db42
3
+ metadata.gz: 8469d3a208d0f04205302c18b3c3b4896cefdf59beff7f30370979bf4fb6c1c0
4
+ data.tar.gz: 1c246fc93a1907d520bf6a2d45383c188349015b6f035a76ed588194353907e0
5
5
  SHA512:
6
- metadata.gz: 8f9adb3f505ef053e0b0abb28c9ee2d6da8b88456435db42ae5b8fcd48942ebbe49cc6dbb43dff2919d08d71217bdc27d6f4cc683bd732c4d3d3833c346cff3e
7
- data.tar.gz: 5d3c7eba42b4a836648a6e5194ba9b8f2948c2931dc803a79ac0b4d074c8b17bc32dda87db926dba44cc733ab944b5208fa18007c62b8f4f26bf45ac722d5717
6
+ metadata.gz: cd5283866a080ab683297dc58f6eadc091da7faae805ab15156f23e1e56d0864e598b6deb132b23689281f47c1393f2dcfc5bfaae0a4833ee2287b8d0213d702
7
+ data.tar.gz: 5d18a0a06bea3b99a6c0c74242c05f202b3c47ec0cfefda219ae018575e4b0e1555c24737190ad3af8702384ccc10a7e1d019c5af54dbf66fd2f44b530a5123c
data/lib/validy.rb CHANGED
@@ -143,7 +143,9 @@ module Validy
143
143
  return self unless valid?
144
144
 
145
145
  @evaluating_attribute_value = instance_variable_get("@#{attribute}")
146
- validate_condition(@evaluating_attribute_value, error || "#{attribute} required!", &block)
146
+ unless @evaluating_attribute_value.instance_of?(FalseClass)
147
+ validate_condition(@evaluating_attribute_value, error || "#{attribute} required!", &block)
148
+ end
147
149
  self
148
150
  end
149
151
 
@@ -196,7 +198,7 @@ module Validy
196
198
  end
197
199
 
198
200
  def validate_condition(condition, error = nil, &block)
199
- return if condition.nil? # bugfix for boolean condition that can return false
201
+ return if condition
200
202
 
201
203
  error_hash = error_hash error
202
204
  add_error error_hash
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5.1
4
+ version: 1.1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov