Permalink
Browse files

small refactoring

  • Loading branch information...
1 parent 1606fc9 commit 7b9964c2ad2945be417179bfd73e67a45a263664 @tenderlove tenderlove committed with tenderlove May 5, 2014
Showing with 2 additions and 6 deletions.
  1. +2 −6 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
View
8 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -135,17 +135,13 @@ def polymorphic_url(record_or_hash_or_array, options = {})
record = record_list.pop
- inflection = nil
-
+ inflection = :singular
should_pop = true
+
if record.try(:persisted?)
should_pop = false
- inflection = :singular
elsif options[:action] == 'new'
- should_pop = true
- inflection = :singular
else
- should_pop = true
inflection = :plural
end

0 comments on commit 7b9964c

Please sign in to comment.