Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure asset_path defaults to nil for application

  • Loading branch information...
commit 1860d873f23446ec9c442a9a8625b74f0dd42594 1 parent d1387a9
@josevalim josevalim authored
View
4 railties/lib/rails/application.rb
@@ -138,6 +138,10 @@ def config
protected
+ def default_asset_path
+ nil
+ end
+
def default_middleware_stack
ActionDispatch::MiddlewareStack.new.tap do |middleware|
rack_cache = config.action_controller.perform_caching && config.action_dispatch.rack_cache
View
7 railties/lib/rails/engine.rb
@@ -499,7 +499,7 @@ def load_seed
end
initializer :append_asset_paths do
- config.asset_path ||= "/#{railtie_name}%s"
+ config.asset_path ||= default_asset_path
public_path = paths["public"].first
if config.compiled_asset_path && File.exist?(public_path)
@@ -553,6 +553,11 @@ def load_seed
end
protected
+
+ def default_asset_path
+ "/#{railtie_name}%s"
+ end
+
def routes?
defined?(@routes)
end
View
5 railties/test/application/configuration_test.rb
@@ -95,6 +95,11 @@ def teardown
assert AppTemplate::Application.config.allow_concurrency
end
+ test "asset_path defaults to nil for application" do
+ require "#{app_path}/config/environment"
+ assert_equal nil, AppTemplate::Application.config.asset_path
+ end
+
test "the application can be marked as threadsafe when there are no frameworks" do
FileUtils.rm_rf("#{app_path}/config/environments")
add_to_config <<-RUBY
Please sign in to comment.
Something went wrong with that request. Please try again.