Sha256: 717a9aac3c417eca38a33242ace1f443706577b739ea16b04e8a4ecbf708336c
Contents?: true
Size: 798 Bytes
Versions: 16
Compression:
Stored size: 798 Bytes
Contents
# frozen_string_literal: true module IdentityCache class ExpiryHook def initialize(cached_association) @cached_association = cached_association end def install cached_association.validate entry = [parent_class, only_on_foreign_key_change?] child_class.parent_expiration_entries[inverse_name] << entry end private attr_reader :cached_association def only_on_foreign_key_change? cached_association.embedded_by_reference? && !cached_association.reflection.has_scope? end def inverse_name cached_association.inverse_name end def parent_class cached_association.reflection.active_record end def child_class cached_association.reflection.klass end end private_constant :ExpiryHook end
Version data entries
16 entries across 16 versions & 1 rubygems