mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
MemCache store may be given multiple addresses. Closes #2869.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3054 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
4cd8910279
commit
745ea39926
3 changed files with 39 additions and 35 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* MemCache store may be given multiple addresses. #2869 [Ryan Carver <ryan@fivesevensix.com>]
|
||||
|
||||
* Handle cookie parsing irregularity for certain Nokia phones. #2530 [zaitzow@gmail.com]
|
||||
|
||||
* Added PrototypeHelper::JavaScriptGenerator and PrototypeHelper#update_page for easily modifying multiple elements in an Ajax response. [Sam Stephenson] Example:
|
||||
|
|
|
@ -390,12 +390,14 @@ module ActionController #:nodoc:
|
|||
end
|
||||
|
||||
class MemCacheStore < MemoryStore #:nodoc:
|
||||
attr_reader :address
|
||||
attr_reader :addresses
|
||||
|
||||
def initialize(address = 'localhost')
|
||||
def initialize(*addresses)
|
||||
super()
|
||||
@address = address
|
||||
@data = MemCache.new(address)
|
||||
addresses = addresses.flatten
|
||||
addresses = ["localhost"] if addresses.empty?
|
||||
@addresses = addresses
|
||||
@data = MemCache.new(*addresses)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class FragmentCacheStoreSettingTest < Test::Unit::TestCase
|
|||
ActionController::Caching::Fragments::MemCacheStore,
|
||||
ActionController::Base.fragment_cache_store
|
||||
)
|
||||
assert_equal "localhost", ActionController::Base.fragment_cache_store.address
|
||||
assert_equal %w(localhost), ActionController::Base.fragment_cache_store.addresses
|
||||
end
|
||||
|
||||
def test_object_assigned_fragment_cache_store
|
||||
|
|
Loading…
Reference in a new issue