aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/url_rewriter.rb
diff options
context:
space:
mode:
authorNathan de Vries <nathan@atnan.com>2009-01-28 19:31:48 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-01-28 19:31:48 +0000
commit32eeb3e5211a4a7bfc7a1d0aa0cab1486bed3581 (patch)
tree541f742c2d89e8a90346723ea43d969a70c7c832 /actionpack/lib/action_controller/url_rewriter.rb
parent74871961eccdb455f18e8ef66716041f2f828ba8 (diff)
downloadrails-32eeb3e5211a4a7bfc7a1d0aa0cab1486bed3581.tar.gz
rails-32eeb3e5211a4a7bfc7a1d0aa0cab1486bed3581.tar.bz2
rails-32eeb3e5211a4a7bfc7a1d0aa0cab1486bed3581.zip
Ensure that when UrlWriter is included in multiple classes, the default_url_options of one don't affect the other. [#1277 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib/action_controller/url_rewriter.rb')
-rw-r--r--actionpack/lib/action_controller/url_rewriter.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb
index d86e2db67d..bb6cb437b7 100644
--- a/actionpack/lib/action_controller/url_rewriter.rb
+++ b/actionpack/lib/action_controller/url_rewriter.rb
@@ -92,15 +92,12 @@ module ActionController
# end
# end
module UrlWriter
- # The default options for urls written by this writer. Typically a <tt>:host</tt>
- # pair is provided.
- mattr_accessor :default_url_options
- self.default_url_options = {}
-
def self.included(base) #:nodoc:
ActionController::Routing::Routes.install_helpers(base)
base.mattr_accessor :default_url_options
- base.default_url_options ||= default_url_options
+
+ # The default options for urls written by this writer. Typically a <tt>:host</tt> pair is provided.
+ base.default_url_options ||= {}
end
# Generate a url based on the options provided, default_url_options and the