From 353df48a341953b1bf457aa6f871a6054d6f64ba Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 28 May 2014 15:50:22 -0700 Subject: fewer blank? calls --- actionpack/lib/action_dispatch/routing/mapper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 178728ea2a..6b6e27ceb0 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -265,14 +265,14 @@ module ActionDispatch if controller.is_a? Regexp hash[:controller] = controller else - check_controller! controller.to_s + check_controller! controller hash[:controller] = controller.to_s if controller end if action.is_a? Regexp hash[:action] = action else - check_action! action.to_s + check_action! action hash[:action] = action.to_s if action end @@ -281,7 +281,7 @@ module ActionDispatch end def check_action!(action) - if action.blank? && segment_keys.exclude?(:action) + if action.nil? && segment_keys.exclude?(:action) message = "Missing :action key on routes definition, please check your routes." raise ArgumentError, message end @@ -292,7 +292,7 @@ module ActionDispatch raise ArgumentError, "controller name should not start with a slash" end - if controller.blank? && segment_keys.exclude?(:controller) + if controller.nil? && segment_keys.exclude?(:controller) message = "Missing :controller key on routes definition, please check your routes." raise ArgumentError, message end -- cgit v1.2.3