Sha256: 06d92b37fbe0993327b095c6134d8bd9d4ca23581451937b8abd75c2c656faf9
Contents?: true
Size: 766 Bytes
Versions: 15
Compression:
Stored size: 766 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::#{item_type}" unless item_type&.starts_with?('BridgeCache::') end class << self private def cleanup(current_row_ids) BridgeCache::AffiliatedSubAccount.where.not(bridge_id: current_row_ids).destroy_all end def unique_column_names %w[bridge_id domain_id] end end end end
Version data entries
15 entries across 15 versions & 1 rubygems