aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-12-09 21:18:41 +0100
committerJosé Valim <jose.valim@gmail.com>2010-12-09 21:19:06 +0100
commit1860d873f23446ec9c442a9a8625b74f0dd42594 (patch)
tree63afbca32b0d6e04d89d787a173d98384e0e08ac /railties
parentd1387a994283d6f4a7dce8fdcb22119b276eed72 (diff)
downloadrails-1860d873f23446ec9c442a9a8625b74f0dd42594.tar.gz
rails-1860d873f23446ec9c442a9a8625b74f0dd42594.tar.bz2
rails-1860d873f23446ec9c442a9a8625b74f0dd42594.zip
Ensure asset_path defaults to nil for application
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb4
-rw-r--r--railties/lib/rails/engine.rb7
-rw-r--r--railties/test/application/configuration_test.rb5
3 files changed, 15 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 182068071d..b248bc737c 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -138,6 +138,10 @@ module Rails
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
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index b188fdfca1..cda0e0a135 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -499,7 +499,7 @@ module Rails
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 @@ module Rails
end
protected
+
+ def default_asset_path
+ "/#{railtie_name}%s"
+ end
+
def routes?
defined?(@routes)
end
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index b8d0854286..c12c4a4660 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -95,6 +95,11 @@ module ApplicationTests
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