Sha256: 3c04fc9837a8d4076a1f9d811ac291ede877d8ef32a263865527feb03fb4485a

Contents?: true

Size: 347 Bytes

Versions: 3

Compression:

Stored size: 347 Bytes

Contents

module EducodeSales
  class MoneyPlanClaim < ApplicationRecord
    belongs_to :money_plan
    belongs_to :money_plan_record
    belongs_to :staff

    after_destroy :update_return_money


    private

    def update_return_money
      self.money_plan.business.update(return_money: self.money_plan.money_plan_claims.sum(:amount))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
educode_sales-1.10.10 app/models/educode_sales/money_plan_claim.rb
educode_sales-1.10.9 app/models/educode_sales/money_plan_claim.rb
educode_sales-1.10.8 app/models/educode_sales/money_plan_claim.rb