diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/initializer.rb | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 6cd2b5364f..a1f9db28e0 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Made the location of the routes file configurable with config.routes_configuration_file (Scott Fleckenstein) [#88] + * Rails Edge info returns the latest git commit hash [Francesc Esplugas] * Added Rails.public_path to control where HTML and assets are expected to be loaded from (defaults to Rails.root + "/public") #11581 [nicksieger] diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 09a98d5aa3..5fd7149858 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -386,6 +386,7 @@ module Rails def initialize_routing return unless configuration.frameworks.include?(:action_controller) ActionController::Routing.controller_paths = configuration.controller_paths + ActionController::Routing::Routes.configuration_file = configuration.routes_configuration_file ActionController::Routing::Routes.reload end @@ -503,6 +504,10 @@ module Rails # The path to the database configuration file to use. (Defaults to # <tt>config/database.yml</tt>.) attr_accessor :database_configuration_file + + # The path to the routes configuration file to use. (Defaults to + # <tt>config/routes.rb</tt>.) + attr_accessor :routes_configuration_file # The list of rails framework components that should be loaded. (Defaults # to <tt>:active_record</tt>, <tt>:action_controller</tt>, @@ -635,6 +640,7 @@ module Rails self.plugin_locators = default_plugin_locators self.plugin_loader = default_plugin_loader self.database_configuration_file = default_database_configuration_file + self.routes_configuration_file = default_routes_configuration_file self.gems = default_gems for framework in default_frameworks @@ -775,6 +781,10 @@ module Rails File.join(root_path, 'config', 'database.yml') end + def default_routes_configuration_file + File.join(root_path, 'config', 'routes.rb') + end + def default_view_path File.join(root_path, 'app', 'views') end |