aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-11-29 19:32:13 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-29 19:32:13 -0800
commit635e2ccd3ea8da64f9ee046cc9d8580007cff679 (patch)
tree0d4b1df8a857bc3e0ca37c069f11d8c18c4f0518 /actionpack
parent9e4621d6f7b7e864c6463da065f17b8ee27ecb81 (diff)
downloadrails-635e2ccd3ea8da64f9ee046cc9d8580007cff679.tar.gz
rails-635e2ccd3ea8da64f9ee046cc9d8580007cff679.tar.bz2
rails-635e2ccd3ea8da64f9ee046cc9d8580007cff679.zip
Extract named_helper module_eval so it's easier to override
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/routing/route_set.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/routing/route_set.rb b/actionpack/lib/action_controller/routing/route_set.rb
index a9690d1807..13646aef61 100644
--- a/actionpack/lib/action_controller/routing/route_set.rb
+++ b/actionpack/lib/action_controller/routing/route_set.rb
@@ -138,9 +138,13 @@ module ActionController
end
end
+ def named_helper_module_eval(code, *args)
+ @module.module_eval(code, *args)
+ end
+
def define_hash_access(route, name, kind, options)
selector = hash_access_name(name, kind)
- @module.module_eval <<-end_eval # We use module_eval to avoid leaks
+ named_helper_module_eval <<-end_eval # We use module_eval to avoid leaks
def #{selector}(options = nil)
options ? #{options.inspect}.merge(options) : #{options.inspect}
end
@@ -168,7 +172,7 @@ module ActionController
#
# foo_url(bar, baz, bang, :sort_by => 'baz')
#
- @module.module_eval <<-end_eval # We use module_eval to avoid leaks
+ named_helper_module_eval <<-end_eval # We use module_eval to avoid leaks
def #{selector}(*args)
#{generate_optimisation_block(route, kind)}