Commit 02e8d95d authored by Rajko Albrecht's avatar Rajko Albrecht
Browse files

Fixed a very stupid error...

parent eb862f1f
......@@ -13,10 +13,12 @@ module ActiveSupport
key = normalize_key(name, options)
instrument(:cas, name, options) do
ttl = cas_expiration options
@data.cas(key,ttl) do |entry|
value = yield entry.value
break true if read_only
options[:raw].present? ? value : Entry.new(value, options)
with do |c|
c.cas(key,ttl) do |entry|
value = yield entry.value
break true if read_only
options[:raw].present? ? value : Entry.new(value, options)
end
end
end
end
......@@ -29,17 +31,19 @@ module ActiveSupport
keys_to_names = Hash[names.map { |name| [normalize_key(name, options), name] }]
instrument(:cas_multi, names, options) do
@data.cas_multi(*(keys_to_names.keys), {:expires_in => cas_expiration(options)}) do |raw_values|
values = {}
raw_values.each do |key, entry|
values[keys_to_names[key]] = entry.value unless entry.expired?
end
values = yield values
break true if read_only
mapped_values = values.map do |name,value|
[normalize_key(name, options),options[:raw].present? ? value : Entry.new(value, options)]
with do |c|
c.cas_multi(*(keys_to_names.keys), {:expires_in => cas_expiration(options)}) do |raw_values|
values = {}
raw_values.each do |key, entry|
values[keys_to_names[key]] = entry.value unless entry.expired?
end
values = yield values
break true if read_only
mapped_values = values.map do |name,value|
[normalize_key(name, options),options[:raw].present? ? value : Entry.new(value, options)]
end
Hash[mapped_values]
end
Hash[mapped_values]
end
true
end
......
......@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
Gem::Specification.new do |s|
s.name = 'redis-activesupport-with-cas'
s.version = '0.0.4'
s.version = '0.0.5'
s.authors = ['Rajko Albrecht']
s.email = ['ral@alwins-world.de']
s.homepage = 'https://git.alwin-it.de/alwin/redis-activesupport-with-cas'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment