Permalink
Browse files

Merge pull request #17 from zonecheung/master

Error when destroying a record with has_one association
  • Loading branch information...
2 parents cfa3c13 + 7b6b4c2 commit d10f247181f7c6ceb36d0be0649469461854004d @orslumen committed Feb 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/record_cache/datastore/active_record_31.rb
@@ -351,7 +351,7 @@ module InstanceMethods
def delete_with_record_cache(method = options[:dependent])
# invalidate :id cache for all record
if load_target
- target.class.record_cache.invalidate(record.id) if target.class.record_cache? unless target.new_record?
+ target.class.record_cache.invalidate(target.id) if target.class.record_cache? unless target.new_record?
end
# invalidate the referenced class for the attribute/value pair on the index cache
@reflection.klass.record_cache.invalidate(@reflection.foreign_key.to_sym, @owner.id) if @reflection.klass.record_cache?

0 comments on commit d10f247

Please sign in to comment.