Sha256: 69e64e86e9db52df364f9c5d37e58a19ad595f70af6be4669165b744adbf2a35
Contents?: true
Size: 590 Bytes
Versions: 34
Compression:
Stored size: 590 Bytes
Contents
# frozen_string_literal: true class Spree::WalletPaymentSource < ActiveRecord::Base belongs_to :user, class_name: Spree::UserClassHandle.new, foreign_key: 'user_id', inverse_of: :wallet_payment_sources belongs_to :payment_source, polymorphic: true, inverse_of: :wallet_payment_sources validates_presence_of :user validates_presence_of :payment_source validate :check_for_payment_source_class private def check_for_payment_source_class if !payment_source.is_a?(Spree::PaymentSource) errors.add(:payment_source, :has_to_be_payment_source_class) end end end
Version data entries
34 entries across 34 versions & 2 rubygems