diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/polymorphic_routes.rb')
-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 |