diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-07-21 17:10:34 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-07-21 17:11:52 +0100 |
commit | e5275f9b5924f36f2bdd4dd9ac0a4f420384748f (patch) | |
tree | fac9d13131a8892725a1a4d50b2087daf8dc9a52 /actionpack | |
parent | 3613235cc3d7d87ce02e51a80f67706c0853b524 (diff) | |
download | rails-e5275f9b5924f36f2bdd4dd9ac0a4f420384748f.tar.gz rails-e5275f9b5924f36f2bdd4dd9ac0a4f420384748f.tar.bz2 rails-e5275f9b5924f36f2bdd4dd9ac0a4f420384748f.zip |
Clear named routes when routes.rb is reloaded
Fix an issue where Journey was failing to clear the named routes hash when the
routes were reloaded and since it doesn't overwrite existing routes then if a
route changed but wasn't renamed it kept the old definition. This was being
masked by the optimised url helpers so it only became apparent when passing an
options hash to the url helper.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG.md | 8 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/journey/routes.rb | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index eac3488a62..ae109852a6 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,11 @@ +* Fix an issue where Journey was failing to clear the named routes hash when the + routes were reloaded and since it doesn't overwrite existing routes then if a + route changed but wasn't renamed it kept the old definition. This was being + masked by the optimised url helpers so it only became apparent when passing an + options hash to the url helper. + + *Andrew White* + * Skip routes pointing to a redirect or mounted application when generating urls using an options hash as they aren't relevant and generate incorrect urls. diff --git a/actionpack/lib/action_dispatch/journey/routes.rb b/actionpack/lib/action_dispatch/journey/routes.rb index a99d6d0d6a..80e3818ccd 100644 --- a/actionpack/lib/action_dispatch/journey/routes.rb +++ b/actionpack/lib/action_dispatch/journey/routes.rb @@ -30,6 +30,7 @@ module ActionDispatch def clear routes.clear + named_routes.clear end def partitioned_routes |