active_validation 4.0.4 → 4.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/active_validation.rb +24 -6
- data/lib/active_validation/version.rb +1 -1
- metadata +1 -2
- data/lib/active_validation/railtie.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ff5f0f171d58eb1aef241aef85f4d4e201a2b0f
|
4
|
+
data.tar.gz: 74f0b459cbbee160ad936388ae51033afa1f7b9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ed76c3d3a02038791088b23129dfdef94ec95c5a5dcab7497b7e25282c84549bc81180d8f794fbf8783e3e52bbd718ac91e92245d2c2f65145224831e0c95fd
|
7
|
+
data.tar.gz: 2a28bc6f07d48db9e69fe0c87592493ddb6ee44d33cfac822b5ca395ef796dbc2a292d3ee8abc2226e54529b6968899a5dd8d37b456518d67bc0e0b03052ed0d
|
data/.rubocop.yml
CHANGED
data/lib/active_validation.rb
CHANGED
@@ -1,16 +1,34 @@
|
|
1
1
|
require 'active_model'
|
2
2
|
require 'active_support'
|
3
|
-
|
4
|
-
%w(version railtie)
|
5
|
-
.each do |file_name|
|
6
|
-
require "active_validation/#{file_name}"
|
7
|
-
end
|
3
|
+
require 'active_validation/version'
|
8
4
|
|
9
5
|
ACTIVE_VALIDATION_VALIDATORS ||= %w(
|
10
6
|
alpha alpha_numeric base64 boolean coordinate credit_card currency cusip email equality hex imei
|
11
7
|
ip isbn isin mac_address name password phone sedol slug ssn tracking_number type url username uuid
|
12
|
-
)
|
8
|
+
).freeze
|
13
9
|
|
14
10
|
ACTIVE_VALIDATION_VALIDATORS.each do |file_name|
|
15
11
|
require "active_validation/validators/#{file_name}_validator"
|
16
12
|
end
|
13
|
+
|
14
|
+
if defined?(Rails)
|
15
|
+
require 'rails'
|
16
|
+
|
17
|
+
module ActiveValidation
|
18
|
+
class Railtie < ::Rails::Railtie
|
19
|
+
|
20
|
+
initializer 'active_validation' do |app|
|
21
|
+
ActiveValidation::Railtie.instance_eval do
|
22
|
+
[app.config.i18n.available_locales].flatten.each do |locale|
|
23
|
+
(I18n.load_path << path(locale)) if File.file?(path(locale))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.path(locale)
|
29
|
+
File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
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.
|
4
|
+
version: 4.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
@@ -178,7 +178,6 @@ 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
|
182
181
|
- lib/active_validation/validators/alpha_numeric_validator.rb
|
183
182
|
- lib/active_validation/validators/alpha_validator.rb
|
184
183
|
- lib/active_validation/validators/base64_validator.rb
|
@@ -1,23 +0,0 @@
|
|
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
|