flash_validators 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flash_validators.rb +9 -13
- data/lib/flash_validators/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f39adfbb3c4bcf87f498a72690d187c8991c1a7d
|
4
|
+
data.tar.gz: d3df54977cb19298f77f416c4be1c98aa34c5889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4c5fe49a6245d196a41e96f9b65b16a6cc1842c6bc93f7ef0a086feb459bd9410dcbe475e257fe4364e046f20b2d79b66e544f63950c15365b959281dfda295
|
7
|
+
data.tar.gz: 35a8b32136849d7b3d76f9bf81b110c30abeed85c7e58e13d1925300685ed015b0228371c71cefdd26512595f4a76e917ef7e3eb4bb1c295d72fb866e6c1179f
|
data/lib/flash_validators.rb
CHANGED
@@ -64,30 +64,26 @@ if defined?(Rails)
|
|
64
64
|
require 'rails'
|
65
65
|
|
66
66
|
module FlashValidators
|
67
|
-
class Railtie < ::Rails::Railtie
|
67
|
+
class Railtie < ::Rails::Railtie
|
68
68
|
initializer 'flash_validators' do |app|
|
69
69
|
FlashValidators::Railtie.instance_eval do
|
70
|
-
|
70
|
+
locales = locales_from(app.config.i18n.available_locales)
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
pattern.each do |locale|
|
76
|
-
add(locale)
|
77
|
-
end
|
78
|
-
end
|
72
|
+
locales.each do |locale|
|
73
|
+
add(locale)
|
74
|
+
end
|
79
75
|
end
|
80
76
|
end
|
81
77
|
|
82
78
|
protected
|
83
79
|
|
84
|
-
def self.add(
|
85
|
-
I18n.load_path << File.expand_path("../../config/locales/#{
|
80
|
+
def self.add(locale)
|
81
|
+
I18n.load_path << File.expand_path("../../config/locales/#{locale}.yml", __FILE__)
|
86
82
|
end
|
87
83
|
|
88
|
-
def self.
|
84
|
+
def self.locales_from(args)
|
89
85
|
array = Array(args || [])
|
90
|
-
array.blank? ? '*' :
|
86
|
+
array.blank? ? '*' : array
|
91
87
|
end
|
92
88
|
end
|
93
89
|
end
|