Skip to content

Commit

Permalink
Merge pull request #2229 from ekylibre/feature/ux-debug/#1901-loans#c…
Browse files Browse the repository at this point in the history
…onfirm_ActiveRecord_StatementInvalid

fixed undefined method +  for nil:NilClass
  • Loading branch information
burisu committed Aug 14, 2018
2 parents 88a1130 + 6b287b9 commit dac802f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/loan_repayment.rb
Expand Up @@ -66,6 +66,9 @@ class LoanRepayment < Ekylibre::Record::Base
}

before_validation do
base_amount ||= 0
insurance_amount ||= 0
interest_amount ||= 0
self.amount = base_amount + insurance_amount + interest_amount
end

Expand Down

0 comments on commit dac802f

Please sign in to comment.