Fix some CC issues

This commit is contained in:
Karl Erik Õunapuu 2020-09-07 13:11:40 +03:00
parent 098d777162
commit b5668ea494
No known key found for this signature in database
GPG key ID: C9DD647298A34764

View file

@ -6,15 +6,15 @@ class BankStatement < ApplicationRecord
validates :bank_code, :iban, presence: true
FULLY_BINDED = 'fully_binded'
PARTIALLY_BINDED = 'partially_binded'
NOT_BINDED = 'not_binded'
FULLY_BINDED = 'fully_binded'.freeze
PARTIALLY_BINDED = 'partially_binded'.freeze
NOT_BINDED = 'not_binded'.freeze
# TODO: Cache this to database so it can be used for searching
def status
if bank_transactions.unbinded.count == bank_transactions.count
NOT_BINDED
elsif bank_transactions.unbinded.count == 0
elsif bank_transactions.unbinded.count.zero?
FULLY_BINDED
else
PARTIALLY_BINDED