aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCoraline Ada Ehmke + Aaron Patterson <aaron.patterson@gmail.com>2014-05-05 16:51:58 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-12 15:54:43 -0700
commit7b9964c2ad2945be417179bfd73e67a45a263664 (patch)
treec4e9a47e89e0d78f0d289da39a5e382cb5741c2e
parent1606fc9d840da869a60213bc889da6fcf1fdc431 (diff)
downloadrails-7b9964c2ad2945be417179bfd73e67a45a263664.tar.gz
rails-7b9964c2ad2945be417179bfd73e67a45a263664.tar.bz2
rails-7b9964c2ad2945be417179bfd73e67a45a263664.zip
small refactoring
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
index 0cc17f5cea..9b76e7d7b5 100644
--- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
+++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -135,17 +135,13 @@ module ActionDispatch
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