Created
September 21, 2009 21:04
-
-
Save usergenic/190551 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleConfig.class_eval do | |
def method_missing_with_rails_env(m,*a,&b) | |
method_missing_without_rails_env(m,*a,&b) | |
rescue NoMethodError => e | |
if has_key?(RAILS_ENV) | |
env = self[RAILS_ENV] | |
return env[m] if env.has_key?(m) | |
end | |
raise e | |
end | |
alias_method_chain :method_missing, :rails_env | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment