aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-06 15:45:40 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-12 15:54:44 -0700
commitd94cd869c82bc52388b670553ee08ad34679fc42 (patch)
tree8fc1a39d20acc9b86091ac12ea3eeb506a93cb1d /actionpack/lib/action_dispatch
parentad31afe63cb50372788e7c3aab15d73ba045a86f (diff)
downloadrails-d94cd869c82bc52388b670553ee08ad34679fc42.tar.gz
rails-d94cd869c82bc52388b670553ee08ad34679fc42.tar.bz2
rails-d94cd869c82bc52388b670553ee08ad34679fc42.zip
remove should_pop variable
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
index 192ab51db4..c3e9dde583 100644
--- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
+++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -133,11 +133,9 @@ module ActionDispatch
end
inflection = lambda { |name| name.singular_route_key }
- should_pop = true
if options[:action] == 'new'
elsif record.try(:persisted?)
- should_pop = false
else
inflection = lambda { |name| name.route_key }
end
@@ -162,10 +160,9 @@ module ActionDispatch
when Symbol, String
record.to_s
when Class
- args << record unless should_pop
inflection.call record.model_name
else
- args << record.to_model unless should_pop
+ args << record.to_model if record.persisted?
inflection.call record.to_model.class.model_name
end