inline_forms 1.6.16 → 1.6.17
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/lib/app/validators/{is_a_curacao_id_number_validator.rb → curacao_id_number_validator.rb}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class
|
2
|
+
class CuracaoIdNumberValidator < ActiveModel::EachValidator
|
3
3
|
|
4
4
|
def validate_each(record, attribute, value)
|
5
5
|
if value =~ /^[0-9]{10}$/
|
@@ -10,13 +10,14 @@ class IsACuracaoIdNumberValidator < ActiveModel::EachValidator
|
|
10
10
|
begin
|
11
11
|
DateTime.civil(year, month, day)
|
12
12
|
rescue ArgumentError
|
13
|
-
record.errors.add(attribute.to_sym, options[:message] || "
|
13
|
+
record.errors.add(attribute.to_sym, options[:message] || "not a valid date" )
|
14
14
|
end
|
15
15
|
else
|
16
|
-
record.errors.add(attribute.to_sym, options[:message] || "
|
16
|
+
record.errors.add(attribute.to_sym, options[:message] || "is not a number" )
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
end
|
21
21
|
|
22
22
|
#"moet bestaan uit tien cijfers (bijvoorbeeld 1983040812)."
|
23
|
+
#"moet een datum zijn."
|
data/lib/inline_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -265,7 +265,7 @@ files:
|
|
265
265
|
- lib/app/helpers/form_elements/text_field.rb
|
266
266
|
- lib/app/helpers/inline_forms_helper.rb
|
267
267
|
- lib/app/models/geo_code_curacao.rb
|
268
|
-
- lib/app/validators/
|
268
|
+
- lib/app/validators/curacao_id_number_validator.rb
|
269
269
|
- lib/app/validators/is_curacao_phone_validator.rb
|
270
270
|
- lib/app/validators/is_email_address_validator.rb
|
271
271
|
- lib/app/validators/must_be_a_value_validator.rb
|