active_validation 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5900ea8701e57940246bd10f2008d20b476b9ac2
4
- data.tar.gz: a263fb5af884117a892f8cf956c2522452d92d1a
3
+ metadata.gz: 5dc9006c431c349e2cb4c6d012dde841d03aa244
4
+ data.tar.gz: 90f9a78a749cbd059bb0cbfb40aa38775a4e8268
5
5
  SHA512:
6
- metadata.gz: b9e37a268bd06a3cd969ac9956425ccff6fa2e3d26d735a7c1b13913a20b66d2d1b5b5a1ec06df5e3e4fe61f441b56d260cf1da01897d15644f30cd314eb108d
7
- data.tar.gz: da8b17e845ecdcd7c5e4f2ea359fd44622dca810e9c8289b17fc254857c605f465aacfcaee70b0d27f81385cadc1b7e91a481ade9527290f67156cc918d218ad
6
+ metadata.gz: feb800f47390fd540cc12973e418eb60fd1435329d4990b3aa36a84b8ecb9c8393f609947e8a2c4fc0f1399ede07a2cdb047f4af02e3f87d71d7e69e0d753c4d
7
+ data.tar.gz: 8ed76e436c0c83e89cfb4c1f582c543f9228b5bb93b71ff593f9a1f15d3346bb9133a5b992469af7c838f75610becf5bcc1bb3e5a1de20889840a3f666593f11
@@ -1,7 +1,7 @@
1
1
  require 'active_model'
2
2
  require 'active_support'
3
3
 
4
- %w(version railtie)
4
+ %w(version)
5
5
  .each do |file_name|
6
6
  require "active_validation/#{file_name}"
7
7
  end
@@ -14,3 +14,27 @@ 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
@@ -1,3 +1,3 @@
1
1
  module ActiveValidation
2
- VERSION = '4.0.2'.freeze
2
+ VERSION = '4.0.3'.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.2
4
+ version: 4.0.3
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,21 +0,0 @@
1
- if defined?(Rails)
2
- require 'rails'
3
-
4
- class ActiveValidation::Railtie < ::Rails::Railtie
5
-
6
- initializer 'active_validation' do |app|
7
- ActiveValidation::Railtie.instance_eval do
8
- [app.config.i18n.available_locales].flatten.each do |locale|
9
- (I18n.load_path << path(locale)) if File.file?(path(locale))
10
- end
11
- end
12
- end
13
-
14
- protected
15
-
16
- def self.path(locale)
17
- File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
18
- end
19
-
20
- end
21
- end