validation_profiler 1.0.0 → 1.0.1

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: b9871f7c011b21c0dab41e770af21eb9eaf17000
4
- data.tar.gz: 698f44e7f2551c825fa464798ce888f6b411cf17
3
+ metadata.gz: 0e73f7df9dd6ae5d0a38f0b5289eae7fcf5c5169
4
+ data.tar.gz: dc60c99963b059bbdbe24b904f3817e4ecb56661
5
5
  SHA512:
6
- metadata.gz: 6c2c68a188987fdaa05b07924a273621d7c7b853f16dadf20cb00cafbeb8abe515620913bd2aeb0ee997fcd7dbafa4b2dc285a70676331807d17d04b9cc4b736
7
- data.tar.gz: d5d08fe310902cee592e3129810fdee6a3fa984806fa6752600977f080cf87f0ec05adaeb41800327c6c9dd4cb410b3df44a14d10ef6af51a0e8b87fe85afaa2
6
+ metadata.gz: 2755117a1870bbf2869486555eaaf05cb5f3ef03fe9727e060248d37afdc36224d380d00ae2a1e0360c19b590c2d1f0be3030883bb842fedecbba820290a1903
7
+ data.tar.gz: c7c33f53245c9514bd070bbee7d16002e8bb52741f9562561535659b9199dd17e1341504069adf8f566e678beb85fd2e7c134d44db81df8e157e6fc02ac3c5cd
@@ -2,10 +2,6 @@ module ValidationProfiler
2
2
  module Rules
3
3
  class ChildValidationRule < ValidationProfiler::Rules::ValidationRule
4
4
 
5
- def initialize
6
- @validation_manager = ValidationProfiler::Manager.new
7
- end
8
-
9
5
  def error_message(field, attributes = {}, parent = nil)
10
6
 
11
7
  field_name = field.to_s
@@ -45,7 +41,7 @@ module ValidationProfiler
45
41
  parent_field = "#{parent.to_s}.#{field.to_s}"
46
42
  end
47
43
 
48
- return @validation_manager.validate(field_value, profile, parent_field)
44
+ return ValidationProfiler::Manager.new.validate(field_value, profile, parent_field)
49
45
 
50
46
  end
51
47
 
@@ -1,3 +1,3 @@
1
1
  module ValidationProfiler
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -52,8 +52,9 @@ module ValidationProfiler
52
52
  rule = ValidationProfiler::Rules::Manager.instance.get_rule(r[:name])
53
53
  outcome = rule.validate(obj, r[:field], r[:attributes], parent)
54
54
 
55
- if outcome.is_a?(ValidationProfiler::ManagerResult)
56
- result = outcome
55
+ if outcome.is_a?(ValidationProfiler::ManagerResult) && !outcome.outcome
56
+ result.errors = result.errors + outcome.errors
57
+ result.outcome = false
57
58
  elsif !outcome
58
59
  result.outcome = false
59
60
  result.errors.push({ field: r[:field], message: rule.error_message(r[:field], r[:attributes], parent) })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validation_profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaughanbrittonsage