class CreditPayment < ActiveRecord::Base belongs_to :customer belongs_to :pointsale belongs_to :user belongs_to :credit has_one :cash_registers_move enum status: [:active, :cancelled] scope :activos, -> { where(credit_payments: { status: 0 }) } end