rails_config 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rails_config/railtie.rb +10 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/lib/rails_config/railtie.rb
CHANGED
@@ -2,6 +2,7 @@ if defined?(Rails::Railtie)
|
|
2
2
|
module RailsConfig
|
3
3
|
class Railtie < Rails::Railtie
|
4
4
|
|
5
|
+
# Parse the settings before any of the initializers
|
5
6
|
ActiveSupport.on_load :before_initialize, :yield => true do
|
6
7
|
::Settings = RailsConfig.load_files(
|
7
8
|
Rails.root.join("config", "settings.yml").to_s,
|
@@ -10,6 +11,15 @@ if defined?(Rails::Railtie)
|
|
10
11
|
)
|
11
12
|
end
|
12
13
|
|
14
|
+
# Rails Dev environment should reload the Settings on every request
|
15
|
+
if Rails.env.development?
|
16
|
+
initializer :rails_config_reload_on_development do
|
17
|
+
ActionController::Base.class_eval do
|
18
|
+
prepend_before_filter { ::Settings.reload! }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
end
|
14
24
|
end
|
15
25
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jacques Crocker
|