Add reference_calculator
This commit is contained in:
parent
d75b881318
commit
e16f03eebf
11 changed files with 133 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
class FinancialTransactionType < ApplicationRecord
|
||||
belongs_to :financial_transaction_class
|
||||
belongs_to :bank_account
|
||||
has_many :financial_transactions, dependent: :restrict_with_exception
|
||||
|
||||
validates :name, presence: true
|
||||
|
|
@ -10,6 +11,8 @@ class FinancialTransactionType < ApplicationRecord
|
|||
|
||||
before_destroy :restrict_deleting_last_financial_transaction_type
|
||||
|
||||
scope :with_name_short, -> { where.not(name_short: [nil, '']) }
|
||||
|
||||
def self.default
|
||||
first
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue