diff options
author | Cheah Chu Yeow <chuyeow@gmail.com> | 2008-05-04 23:54:08 +0800 |
---|---|---|
committer | rick <rick@spacemonkey.local> | 2008-05-05 23:41:33 -0700 |
commit | ee1d508a6bbdbfafb20516ebb4b452f1596f9ebe (patch) | |
tree | 4bc2991c6819f50de9b44201033751baf9e27434 /actionpack/lib/action_controller/routing | |
parent | 04d85548608eb42f2d7071daa4661c5eac3a552a (diff) | |
download | rails-ee1d508a6bbdbfafb20516ebb4b452f1596f9ebe.tar.gz rails-ee1d508a6bbdbfafb20516ebb4b452f1596f9ebe.tar.bz2 rails-ee1d508a6bbdbfafb20516ebb4b452f1596f9ebe.zip |
Allow ActionController::Base#default_url_options to have a default options argument of nil.
This fixes a bug introduced in [6a6b4392c16c665eb713705f2b38e959a658eeef] which was breaking routing in ActionController::UrlWriter.
Diffstat (limited to 'actionpack/lib/action_controller/routing')
-rw-r--r-- | actionpack/lib/action_controller/routing/optimisations.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/routing/optimisations.rb b/actionpack/lib/action_controller/routing/optimisations.rb index 3e3a2225f0..cd4a423e6b 100644 --- a/actionpack/lib/action_controller/routing/optimisations.rb +++ b/actionpack/lib/action_controller/routing/optimisations.rb @@ -61,9 +61,9 @@ module ActionController # if they're using foo_url(:id=>2) it's one # argument, but we don't want to generate /foos/id2 if number_of_arguments == 1 - "(!defined?(default_url_options) || default_url_options(nil).blank?) && defined?(request) && request && args.size == 1 && !args.first.is_a?(Hash)" + "(!defined?(default_url_options) || default_url_options.blank?) && defined?(request) && request && args.size == 1 && !args.first.is_a?(Hash)" else - "(!defined?(default_url_options) || default_url_options(nil).blank?) && defined?(request) && request && args.size == #{number_of_arguments}" + "(!defined?(default_url_options) || default_url_options.blank?) && defined?(request) && request && args.size == #{number_of_arguments}" end end @@ -98,7 +98,7 @@ module ActionController # argument class PositionalArgumentsWithAdditionalParams < PositionalArguments def guard_condition - "(!defined?(default_url_options) || default_url_options(nil).blank?) && defined?(request) && request && args.size == #{route.segment_keys.size + 1} && !args.last.has_key?(:anchor) && !args.last.has_key?(:port) && !args.last.has_key?(:host)" + "(!defined?(default_url_options) || default_url_options.blank?) && defined?(request) && request && args.size == #{route.segment_keys.size + 1} && !args.last.has_key?(:anchor) && !args.last.has_key?(:port) && !args.last.has_key?(:host)" end # This case uses almost the same code as positional arguments, |