Skip to content
Browse files

fewer blank? calls

  • Loading branch information...
1 parent c99d28f commit 353df48a341953b1bf457aa6f871a6054d6f64ba @tenderlove tenderlove committed May 28, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 actionpack/lib/action_dispatch/routing/mapper.rb
View
8 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -265,14 +265,14 @@ def default_controller_and_action
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 @@ def default_controller_and_action
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 @@ def check_controller!(controller)
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

0 comments on commit 353df48

Please sign in to comment.
Something went wrong with that request. Please try again.