spanish_ccc_validator 0.0.3 → 0.0.4
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.
data/README.rdoc
CHANGED
@@ -26,8 +26,6 @@ It can be mixed with all options you're used to
|
|
26
26
|
validate_spanish_ccc :origin_account_number, :destination_account_number,
|
27
27
|
:message => "seems incorrect",
|
28
28
|
:if => lambda { |sell| sell.payment_method == 'transfer' }
|
29
|
-
|
30
|
-
== TODO
|
31
|
-
* Write specs
|
29
|
+
|
32
30
|
|
33
31
|
Copyright (c) 2012 Miguel Camba
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "spanish_ccc_validator/version"
|
2
|
-
require "spanish_ccc_validator/
|
2
|
+
require "spanish_ccc_validator/custom_ccc_validator"
|
3
3
|
|
4
4
|
module SpanishCccValidator
|
5
5
|
|
@@ -14,7 +14,7 @@ module SpanishCccValidator
|
|
14
14
|
|
15
15
|
validates_each(args, config) do |record, arg, value|
|
16
16
|
error_msg = config[:message].is_a?(Proc) ? config[:message].call : config[:message]
|
17
|
-
record.errors.add(arg, error_msg) unless
|
17
|
+
record.errors.add(arg, error_msg) unless CustomCccValidator.validate(value)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spanish_ccc_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- miguel.camba
|
@@ -48,7 +48,7 @@ files:
|
|
48
48
|
- README.rdoc
|
49
49
|
- Rakefile
|
50
50
|
- lib/spanish_ccc_validator.rb
|
51
|
-
- lib/spanish_ccc_validator/
|
51
|
+
- lib/spanish_ccc_validator/custom_ccc_validator.rb
|
52
52
|
- lib/spanish_ccc_validator/version.rb
|
53
53
|
- spanish_ccc_validator.gemspec
|
54
54
|
- spec/spanish_ccc_validator_spec.rb
|