aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
diff options
context:
space:
mode:
authorthedarkone <thedarkone2@gmail.com>2010-09-27 17:44:11 +0200
committerthedarkone <thedarkone2@gmail.com>2010-09-27 17:46:00 +0200
commitbb47927d914480218b003d322c8e8ebcd388093e (patch)
treef352c4c649885ebfce97bc4917d8195e1550a598 /actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
parentb127e0cac97886d9fcaaea7b91f88becd2fcff2c (diff)
downloadrails-bb47927d914480218b003d322c8e8ebcd388093e.tar.gz
rails-bb47927d914480218b003d322c8e8ebcd388093e.tar.bz2
rails-bb47927d914480218b003d322c8e8ebcd388093e.zip
Convert unless/else into if/else.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/polymorphic_routes.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
index eaef09d445..49e237f8db 100644
--- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
+++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -168,10 +168,7 @@ module ActionDispatch
end
def build_named_route_call(records, inflection, options = {})
- unless records.is_a?(Array)
- record = extract_record(records)
- route = []
- else
+ if records.is_a?(Array)
record = records.pop
route = records.map do |parent|
if parent.is_a?(Symbol) || parent.is_a?(String)
@@ -180,6 +177,9 @@ module ActionDispatch
ActiveModel::Naming.route_key(parent).singularize
end
end
+ else
+ record = extract_record(records)
+ route = []
end
if record.is_a?(Symbol) || record.is_a?(String)