aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-11-28 23:56:42 -0800
committerJosé Valim <jose.valim@gmail.com>2011-11-28 23:56:42 -0800
commit913c42a6a949702c4305e03e0122f08306ef2b72 (patch)
treeec77d3b5b742d1f7587ec262d36fb5f8b5d8e11e /actionpack/lib
parent52a9884ce486dc97e0a8d88d0126ac6194d52346 (diff)
parentd3bc12b27feb96e8799e2bcdc6e52b2704360aa3 (diff)
downloadrails-913c42a6a949702c4305e03e0122f08306ef2b72.tar.gz
rails-913c42a6a949702c4305e03e0122f08306ef2b72.tar.bz2
rails-913c42a6a949702c4305e03e0122f08306ef2b72.zip
Merge pull request #3793 from marcandre/asset_host
Handle correctly optional parameters for callable asset_host.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/asset_paths.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb
index 1d16e34df6..aa5db0d7bc 100644
--- a/actionpack/lib/action_view/asset_paths.rb
+++ b/actionpack/lib/action_view/asset_paths.rb
@@ -103,8 +103,8 @@ module ActionView
if host.respond_to?(:call)
args = [source]
arity = arity_of(host)
- if arity > 1 && !has_request?
- invalid_asset_host!("Remove the second argument to your asset_host Proc if you do not need the request.")
+ if (arity > 1 || arity < -2) && !has_request?
+ invalid_asset_host!("Remove the second argument to your asset_host Proc if you do not need the request, or make it optional.")
end
args << current_request if (arity > 1 || arity < 0) && has_request?
host.call(*args)