lib/rails-settings/settings.rb in rails-settings-cached-0.7.1 vs lib/rails-settings/settings.rb in rails-settings-cached-0.7.2
- old
+ new
@@ -59,9 +59,11 @@
vars
end
# get a setting value by [] notation
def [](var_name)
+ return Default[var_name] unless rails_initialized?
+
val = object(var_name)
return val.value if val
return Default[var_name] if Default.enabled?
end