activemodel-behavior_validator 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/behavior_validator.rb +1 -1
- data/lib/behavior_validator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d519abbff2d6e09d869208a5fd13f7120cde9b3
|
4
|
+
data.tar.gz: 4fce249bd6490a6e52034c79e3f871caf5b03687
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baec5e9ee737b8d7c39d3a770af23752a8fee07b7516b063ac23ec26735d68bdc63a7f1fe5fd2e0626f19b5272a0607b01663fc25e0c698bb7d9a047164f6240
|
7
|
+
data.tar.gz: 644342f9ceb7f22325f7b9d0046955b567cfdb2cc483ce475fe056cdf13cb6d8df7ee61cfb9f87960775aaba3e3b8901b29c580c56fea0532e89987f93be9671
|
data/lib/behavior_validator.rb
CHANGED
@@ -3,7 +3,7 @@ class BehaviorValidator < ActiveModel::EachValidator
|
|
3
3
|
def valid?(value, options = {})
|
4
4
|
options = options.reject { |option| reserved_options.include?(option) }
|
5
5
|
options.each_pair.all? do |method, expected_result|
|
6
|
-
value.
|
6
|
+
value.respond_to?(method) && value.__send__(method) == expected_result
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|