diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/configuration.rb | 7 | ||||
-rw-r--r-- | railties/lib/rails/generators.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/test_case.rb | 7 |
4 files changed, 13 insertions, 8 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 31787b5cc9..d6ad045294 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -5,7 +5,7 @@ module Rails class Configuration < ::Rails::Engine::Configuration include ::Rails::Configuration::Deprecated - attr_accessor :cache_classes, :cache_store, :colorize_logging, + attr_accessor :allow_concurrency, :cache_classes, :cache_store, :colorize_logging, :consider_all_requests_local, :dependency_loading, :filter_parameters, :log_level, :logger, :metals, :plugins, :preload_frameworks, :reload_engines, :reload_plugins, @@ -13,11 +13,13 @@ module Rails def initialize(*) super + @allow_concurrency = false @colorize_logging = true @filter_parameters = [] @dependency_loading = true @serve_static_assets = true @time_zone = "UTC" + @consider_all_requests_local = true end def paths @@ -50,7 +52,7 @@ module Rails self.preload_frameworks = true self.cache_classes = true self.dependency_loading = false - self.action_controller.allow_concurrency = true if respond_to?(:action_controller) + self.allow_concurrency = true self end diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index 6a4ebe883b..7887a5d25f 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -8,10 +8,10 @@ module Rails def middleware @@default_middleware_stack ||= ActionDispatch::MiddlewareStack.new.tap do |middleware| middleware.use('::ActionDispatch::Static', lambda { Rails.public_path }, :if => lambda { Rails.application.config.serve_static_assets }) - middleware.use('::Rack::Lock', :if => lambda { !ActionController::Base.allow_concurrency }) + middleware.use('::Rack::Lock', :if => lambda { !Rails.application.config.allow_concurrency }) middleware.use('::Rack::Runtime') middleware.use('::Rails::Rack::Logger') - middleware.use('::ActionDispatch::ShowExceptions', lambda { ActionController::Base.consider_all_requests_local }) + middleware.use('::ActionDispatch::ShowExceptions', lambda { Rails.application.config.consider_all_requests_local }) middleware.use('::ActionDispatch::Callbacks', lambda { !Rails.application.config.cache_classes }) middleware.use('::ActionDispatch::Cookies') middleware.use(lambda { ActionController::Base.session_store }, lambda { ActionController::Base.session_options }) @@ -88,11 +88,12 @@ module Rails end class Generators #:nodoc: - attr_accessor :aliases, :options, :colorize_logging + attr_accessor :aliases, :options, :fallbacks, :colorize_logging def initialize @aliases = Hash.new { |h,k| h[k] = {} } @options = Hash.new { |h,k| h[k] = {} } + @fallbacks = {} @colorize_logging = true end diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 90b513fcb4..8c54014fcb 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -67,6 +67,7 @@ module Rails no_color! unless config.colorize_logging aliases.deep_merge! config.aliases options.deep_merge! config.options + fallbacks.merge! config.fallbacks end def self.aliases #:nodoc: diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 38a3cbb035..6b97c69d8d 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -1,4 +1,5 @@ -require 'active_support/core_ext/class/inheritable_attributes' +require 'active_support/core_ext/class/attribute' +require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/hash/reverse_merge' require 'rails/generators' require 'fileutils' @@ -28,8 +29,8 @@ module Rails class TestCase < ActiveSupport::TestCase include FileUtils - extlib_inheritable_accessor :destination_root, :current_path, :generator_class, - :default_arguments, :instance_writer => false + class_attribute :destination_root, :current_path, :generator_class, :default_arguments + delegate :destination_root, :current_path, :generator_class, :default_arguments, :to => :'self.class' # Generators frequently change the current path using +FileUtils.cd+. # So we need to store the path at file load and revert back to it after each test. |