Sha256: d8f9d2ce3e6f9f5750bf1bc14638133aa82ab7579d9127f8f9fc90b16149f74e
Contents?: true
Size: 709 Bytes
Versions: 12
Compression:
Stored size: 709 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 def self.unique_column_names %w[bridge_id domain_id] end end end
Version data entries
12 entries across 12 versions & 1 rubygems