lib/lookup_by/cache.rb in lookup_by-0.10.6 vs lib/lookup_by/cache.rb in lookup_by-0.10.7
- old
+ new
@@ -200,17 +200,17 @@
if @safe
def cache_write(object)
return unless object
@mutex.synchronize do
- @reverse[object.send(@field)] = @cache[object.id] = object
+ @reverse[object.send(@field).to_s] = @cache[object.id] = object
end
end
else
def cache_write(object)
return unless object
- @reverse[object.send(@field)] = @cache[object.id] = object
+ @reverse[object.send(@field).to_s] = @cache[object.id] = object
end
end
def db_write(value)
column = column_for(value)