lib/redis/objects/sets.rb in redis-objects-0.3.0 vs lib/redis/objects/sets.rb in redis-objects-0.3.1
- old
+ new
@@ -12,14 +12,14 @@
# Class methods that appear in your class when you include Redis::Objects.
module ClassMethods
# Define a new list. It will function like a regular instance
# method, so it can be used alongside ActiveRecord, DataMapper, etc.
def set(name, options={})
- @redis_objects[name] = options.merge(:type => :set)
+ @redis_objects[name.to_sym] = options.merge(:type => :set)
if options[:global]
instance_eval <<-EndMethods
def #{name}
- @#{name} ||= Redis::Set.new(field_key(:#{name}, ''), redis, @redis_objects[:#{name}])
+ @#{name} ||= Redis::Set.new(field_key(:#{name}), redis, @redis_objects[:#{name}])
end
EndMethods
class_eval <<-EndMethods
def #{name}
self.class.#{name}
\ No newline at end of file