Skip to content

Instantly share code, notes, and snippets.

@uhhuhyeah
Created September 9, 2010 20:28
Show Gist options
  • Save uhhuhyeah/572494 to your computer and use it in GitHub Desktop.
Save uhhuhyeah/572494 to your computer and use it in GitHub Desktop.
# lives in config/initializers/
def recursive_symbolize_keys!(hash)
hash.symbolize_keys!
hash.values.select{|v| v.is_a? Hash}.each{|h| recursive_symbolize_keys!(h)}
end
AppSettings = YAML.load_file("#{Rails.root}/config/settings.yml")[Rails.env]
recursive_symbolize_keys!(AppSettings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment