diff options
author | Coraline Ada Ehmke + Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-05 16:51:58 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-12 15:54:43 -0700 |
commit | 7b9964c2ad2945be417179bfd73e67a45a263664 (patch) | |
tree | c4e9a47e89e0d78f0d289da39a5e382cb5741c2e /actionpack/lib | |
parent | 1606fc9d840da869a60213bc889da6fcf1fdc431 (diff) | |
download | rails-7b9964c2ad2945be417179bfd73e67a45a263664.tar.gz rails-7b9964c2ad2945be417179bfd73e67a45a263664.tar.bz2 rails-7b9964c2ad2945be417179bfd73e67a45a263664.zip |
small refactoring
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 8 |
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 |