Skip to content

Instantly share code, notes, and snippets.

@usergenic
Created September 21, 2009 21:04
Show Gist options
  • Save usergenic/190551 to your computer and use it in GitHub Desktop.
Save usergenic/190551 to your computer and use it in GitHub Desktop.
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