diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-26 02:05:28 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-26 02:05:28 -0800 |
commit | a88094fd7a19a4b2d5c5b5044b10146e6c5c7245 (patch) | |
tree | 917a17bbb1b4bbfacdd7e967e6bf580fd9d3ff59 /actionpack/lib | |
parent | 6599dd907f87875045005c3754fc7fe75c130c3e (diff) | |
download | rails-a88094fd7a19a4b2d5c5b5044b10146e6c5c7245.tar.gz rails-a88094fd7a19a4b2d5c5b5044b10146e6c5c7245.tar.bz2 rails-a88094fd7a19a4b2d5c5b5044b10146e6c5c7245.zip |
No need to have #generate and #generate_extras per instance
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/routing/route.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/routing/route.rb b/actionpack/lib/action_controller/routing/route.rb index a610ec7e84..91c89fe16b 100644 --- a/actionpack/lib/action_controller/routing/route.rb +++ b/actionpack/lib/action_controller/routing/route.rb @@ -122,6 +122,16 @@ module ActionController super end + def generate(options, hash, expire_on = {}) + path, hash = generate_raw(options, hash, expire_on) + append_query_string(path, hash, extra_keys(options)) + end + + def generate_extras(options, hash, expire_on = {}) + path, hash = generate_raw(options, hash, expire_on) + [path, extra_keys(options)] + end + private def requirement_for(key) return requirements[key] if requirements.key? key @@ -150,11 +160,6 @@ module ActionController # the query string. (Never use keys from the recalled request when building the # query string.) - method_decl = "def generate(#{args})\npath, hash = generate_raw(options, hash, expire_on)\nappend_query_string(path, hash, extra_keys(options))\nend" - instance_eval method_decl, "generated code (#{__FILE__}:#{__LINE__})" - - method_decl = "def generate_extras(#{args})\npath, hash = generate_raw(options, hash, expire_on)\n[path, extra_keys(options)]\nend" - instance_eval method_decl, "generated code (#{__FILE__}:#{__LINE__})" raw_method end |