Sha256: e404af03efac860f19874ee3123c1a472a75b3a7468bb3289e85a93544ff72ac
Contents?: true
Size: 638 Bytes
Versions: 10
Compression:
Stored size: 638 Bytes
Contents
module BridgeCache class AffiliatedSubAccount < BridgeBaseModel extend BridgeCache::Data::BridgeModel before_save :fix_item_type belongs_to :item, polymorphic: true, optional: true belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true private def fix_item_type self.item_type = "BridgeCache::#{self.item_type}" unless self.item_type&.starts_with?("BridgeCache::") end def self.cleanup(current_row_ids) BridgeCache::AffiliatedSubAccount.where.not(bridge_id: current_row_ids).destroy_all end end end
Version data entries
10 entries across 10 versions & 1 rubygems