lib/agcod/configuration.rb in agcod-0.0.3 vs lib/agcod/configuration.rb in agcod-0.0.4

- old
+ new

@@ -13,21 +13,21 @@ def load(app_root = nil, env = nil) if app_root @app_root = app_root else - @app_root = RAILS_ROOT if defined?(RAILS_ROOT) + @app_root = Rails.root if defined?(Rails) end if @app_root.nil? || !FileTest.exists?(config_filename = File.join(@app_root, 'config', 'agcod.yml')) raise Error::ConfigurationError, "Configuration for AGCOD not found" end config_file = File.read(config_filename) - environment = RAILS_ENV if defined?(RAILS_ENV) + environment = Rails.env if defined?(Rails) environment = env if env @options = YAML.load(config_file)[environment] validate_options @options