Skip to content

Commit

Permalink
Minor: backport of delete all fix from rails 4.1 to rails 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
orslumen committed Oct 20, 2015
1 parent f5ccce7 commit 75d81af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/record_cache/datastore/active_record_40.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ module ClassMethods

module InstanceMethods
def delete_records_with_record_cache(records, method)
records = load_target if records == :all
# invalidate :id cache for all records
records.each{ |record| record.class.record_cache.invalidate(record.id) if record.class.record_cache? unless record.new_record? }
# invalidate the referenced class for the attribute/value pair on the index cache
Expand Down

0 comments on commit 75d81af

Please sign in to comment.