app/models/payment_application.rb in erp_invoicing-3.0.6 vs app/models/payment_application.rb in erp_invoicing-3.1.0
- old
+ new
@@ -1,14 +1,15 @@
class PaymentApplication < ActiveRecord::Base
+ attr_protected :created_at, :updated_at
belongs_to :financial_txn
belongs_to :payment_applied_to, :polymorphic => true
belongs_to :money, :foreign_key => 'applied_money_amount_id', :dependent => :destroy
before_destroy :unapply_payment
def is_pending?
- (self.financial_txn.is_scheduled? or self.financial_txn.is_pending?) unless self.financial_txn.nil?
+ self.financial_txn.nil? or (self.financial_txn.is_scheduled? or self.financial_txn.is_pending?)
end
def apply_payment
#check the calculate balance strategy, if it includes payments then do nothing
#if it doesn't include payments then update the balance on the model