active_validation 4.0.3 → 4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dc9006c431c349e2cb4c6d012dde841d03aa244
4
- data.tar.gz: 90f9a78a749cbd059bb0cbfb40aa38775a4e8268
3
+ metadata.gz: 8fa33ee5eaf935e3e4ad2534df237304c5645bb7
4
+ data.tar.gz: 5e7832cfa49cc05eb16efd14203e868bef8edac6
5
5
  SHA512:
6
- metadata.gz: feb800f47390fd540cc12973e418eb60fd1435329d4990b3aa36a84b8ecb9c8393f609947e8a2c4fc0f1399ede07a2cdb047f4af02e3f87d71d7e69e0d753c4d
7
- data.tar.gz: 8ed76e436c0c83e89cfb4c1f582c543f9228b5bb93b71ff593f9a1f15d3346bb9133a5b992469af7c838f75610becf5bcc1bb3e5a1de20889840a3f666593f11
6
+ metadata.gz: 932cecc243591dfcf9e06812777db97804de73b749f4f8b8a1b7cd33a014fb4347add0004a4969c0eb82971c3949185b8a2a0efe59a589e37b9f25072dd5c88f
7
+ data.tar.gz: cd8e2c138de7b7c570b5df5a892ae89182fa76df860d9fc41b7edaae09ad4b1ad0b9a4fa02008ce37bfd47be52b0121a6076513cd6fe07325e024c344a2fbc3d
@@ -2,36 +2,36 @@ en:
2
2
  active_validation:
3
3
  errors:
4
4
  messages:
5
- alpha: 'is not a valid alpha characters'
6
- alpha_numeric: 'is not a valid alpha-numeric characters'
7
- base64: 'is not a valid Base64 encode'
5
+ alpha: 'is not in valid alpha format'
6
+ alpha_numeric: 'is not in valid alpha-numeric format'
7
+ base64: 'is not in valid Base64 encode format'
8
8
  boolean: 'is not a valid boolean'
9
9
  coordinate:
10
10
  coordinate: 'is not a valid coordinate'
11
11
  latitude: 'is not a valid latitude'
12
12
  longitude: 'is not a valid longitude'
13
- credit_card: 'is not a valid credit card'
14
- currency: 'is not a valid currency'
15
- cusip: 'is not a valid CUSIP'
16
- email: 'is not a valid email'
13
+ credit_card: 'is not a valid credit card format'
14
+ currency: 'is not in valid currency format'
15
+ cusip: 'is not in valid CUSIP format'
16
+ email: 'is not in valid email format'
17
17
  equality: 'is not %{operator} %{attr}'
18
- hex: 'is not a valid hex color'
19
- imei: 'is not a valid IMEI'
20
- ip: 'is not a valid IP'
21
- isbn: 'is not a valid ISBN'
22
- isin: 'is not a valid ISIN'
23
- mac_address: 'is not a valid MAC address'
24
- name: 'is not a valid name'
25
- password: 'is not a valid password'
26
- phone: 'is not a valid phone number'
27
- sedol: 'is not a valid SEDOL'
28
- slug: 'is not a valid slug'
29
- ssn: 'is not a valid social security number'
30
- tracking_number: 'is not a valid tracking number'
18
+ hex: 'is not in valid hex color format'
19
+ imei: 'is not in valid IMEI format'
20
+ ip: 'is not in valid IP format'
21
+ isbn: 'is not in valid ISBN format'
22
+ isin: 'is not in valid ISIN format'
23
+ mac_address: 'is not in valid MAC address format'
24
+ name: 'is not in valid name format'
25
+ password: 'is not in valid password format'
26
+ phone: 'is not in valid phone number format'
27
+ sedol: 'is not in valid SEDOL format'
28
+ slug: 'is not in valid slug format'
29
+ ssn: 'is not in valid social security number format'
30
+ tracking_number: 'is not in valid tracking number format'
31
31
  type: 'is not a valid type'
32
- url: 'is not a valid URL'
33
- username: 'is not a valid username'
34
- uuid: 'is not a valid UUID'
32
+ url: 'is not in valid URL format'
33
+ username: 'is not in valid username format'
34
+ uuid: 'is not in valid UUID format'
35
35
  matchers:
36
36
  ensure_valid_alpha_format_of:
37
37
  failure_message_for_should: '%{model} should ensure valid alpha format of attribute %{attr}'
@@ -1,7 +1,7 @@
1
1
  require 'active_model'
2
2
  require 'active_support'
3
3
 
4
- %w(version)
4
+ %w(version railtie)
5
5
  .each do |file_name|
6
6
  require "active_validation/#{file_name}"
7
7
  end
@@ -14,27 +14,3 @@ ACTIVE_VALIDATION_VALIDATORS ||= %w(
14
14
  ACTIVE_VALIDATION_VALIDATORS.each do |file_name|
15
15
  require "active_validation/validators/#{file_name}_validator"
16
16
  end
17
-
18
- if defined?(Rails)
19
- require 'rails'
20
-
21
- module ActiveValidation
22
- class Railtie < ::Rails::Railtie
23
-
24
- initializer 'active_validation' do |app|
25
- ActiveValidation::Railtie.instance_eval do
26
- [app.config.i18n.available_locales].flatten.each do |locale|
27
- (I18n.load_path << path(locale)) if File.file?(path(locale))
28
- end
29
- end
30
- end
31
-
32
- protected
33
-
34
- def self.path(locale)
35
- File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
36
- end
37
-
38
- end
39
- end
40
- end
@@ -0,0 +1,23 @@
1
+ if defined?(Rails)
2
+ require 'rails'
3
+
4
+ module ActiveValidation
5
+ class Railtie < ::Rails::Railtie
6
+
7
+ initializer 'active_validation' do |app|
8
+ ActiveValidation::Railtie.instance_eval do
9
+ [app.config.i18n.available_locales].flatten.each do |locale|
10
+ (I18n.load_path << path(locale)) if File.file?(path(locale))
11
+ end
12
+ end
13
+ end
14
+
15
+ def self.path(locale)
16
+ File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
17
+ end
18
+
19
+ private_class_method :path
20
+
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveValidation
2
- VERSION = '4.0.3'.freeze
2
+ VERSION = '4.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
@@ -178,6 +178,7 @@ files:
178
178
  - lib/.DS_Store
179
179
  - lib/active_validation.rb
180
180
  - lib/active_validation/.DS_Store
181
+ - lib/active_validation/railtie.rb
181
182
  - lib/active_validation/validators/alpha_numeric_validator.rb
182
183
  - lib/active_validation/validators/alpha_validator.rb
183
184
  - lib/active_validation/validators/base64_validator.rb