Sha256: 0ee452a625ec0e0fe5a3775f7a16e46a195c7dfdf7741f9e7a550dae1a80ad39
Contents?: true
Size: 517 Bytes
Versions: 8
Compression:
Stored size: 517 Bytes
Contents
module DestroyedAt module HasManyAssociation def delete_records(records, method) if method == :destroy records.each do |r| if r.respond_to?(:destroyed_at) r.destroy(owner.destroyed_at) else r.destroy end end update_counter(-records.length) unless inverse_updates_counter_cache? else super end end end end ActiveRecord::Associations::HasManyAssociation.send(:prepend, DestroyedAt::HasManyAssociation)
Version data entries
8 entries across 8 versions & 1 rubygems