chore: rubocop

chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
This commit is contained in:
Philipp Rothmann 2023-05-12 13:01:12 +02:00 committed by Philipp Rothmann
parent f6fb804bbe
commit fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions

View file

@ -5,10 +5,10 @@ class BankAccount < ApplicationRecord
normalize_attributes :name, :iban, :description
validates :name, :presence => true, :uniqueness => true, :length => { :minimum => 2 }
validates :iban, :presence => true, :uniqueness => true
validates_format_of :iban, :with => /\A[A-Z]{2}[0-9]{2}[0-9A-Z]{,30}\z/
validates_numericality_of :balance, :message => I18n.t('bank_account.model.invalid_balance')
validates :name, presence: true, uniqueness: true, length: { minimum: 2 }
validates :iban, presence: true, uniqueness: true
validates :iban, format: { with: /\A[A-Z]{2}[0-9]{2}[0-9A-Z]{,30}\z/ }
validates :balance, numericality: { message: I18n.t('bank_account.model.invalid_balance') }
# @return [Function] Method wich can be called to import transaction from a bank or nil if unsupported
def find_connector
@ -18,10 +18,8 @@ class BankAccount < ApplicationRecord
def assign_unlinked_transactions
count = 0
bank_transactions.without_financial_link.includes(:supplier, :user).each do |t|
if t.assign_to_ordergroup || t.assign_to_invoice
count += 1
end
bank_transactions.without_financial_link.includes(:supplier, :user).find_each do |t|
count += 1 if t.assign_to_ordergroup || t.assign_to_invoice
end
count
end