From 4163ccec2343ee66e2488f067eab2a15260e1219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 22 Apr 2010 12:00:13 +0200 Subject: Clean up the config object in ActionPack. Create config_accessor which just delegates to the config object, reducing the number of deprecations and add specific tests. --- actionpack/lib/action_controller/caching/pages.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller/caching') diff --git a/actionpack/lib/action_controller/caching/pages.rb b/actionpack/lib/action_controller/caching/pages.rb index 20df3a1a69..cefd1f48c0 100644 --- a/actionpack/lib/action_controller/caching/pages.rb +++ b/actionpack/lib/action_controller/caching/pages.rb @@ -44,8 +44,8 @@ module ActionController #:nodoc: # For Rails, this directory has already been set to Rails.public_path (which is usually set to Rails.root + "/public"). Changing # this setting can be useful to avoid naming conflicts with files in public/, but doing so will likely require configuring your # web server to look in the new location for cached files. - singleton_class.delegate :page_cache_directory, :page_cache_directory=, :to => :config - self.page_cache_directory = '' + config_accessor :page_cache_directory + self.page_cache_directory ||= '' ## # :singleton-method: @@ -53,8 +53,8 @@ module ActionController #:nodoc: # order to make it easy for the cached files to be picked up properly by the web server. By default, this cache extension is .html. # If you want something else, like .php or .shtml, just set Base.page_cache_extension. In cases where a request already has an # extension, such as .xml or .rss, page caching will not add an extension. This allows it to work well with RESTful apps. - singleton_class.delegate :page_cache_extension, :page_cache_extension=, :to => :config - self.page_cache_extension = '.html' + config_accessor :page_cache_extension + self.page_cache_extension ||= '.html' end module ClassMethods -- cgit v1.2.3