Permalink
Browse files

generate IDs as strings, since Redis always uses string IDs. This fix…

…es a bug with Syncro.
  • Loading branch information...
1 parent 8276bbf commit ae68d86d55e3409d81e655e4186ea0ecbcaeb780 @maccman maccman committed Jul 20, 2010
Showing with 3 additions and 8 deletions.
  1. +3 −8 lib/supermodel/redis.rb
View
@@ -102,13 +102,8 @@ def existing(atts = {})
end
end
- module InstanceMethods
- # Redis integers are stored as strings
- def id
- super.try(:to_s)
- end
-
- protected
+ module InstanceMethods
+ protected
def raw_destroy
return if new?
@@ -135,7 +130,7 @@ def create_indexes
end
def generate_id
- redis.incr(self.class.redis_key(:uid))
+ redis.incr(self.class.redis_key(:uid)).to_s
end
def indexed_attributes

0 comments on commit ae68d86

Please sign in to comment.