Class: BankBalanceStatement

Inherits:
ApplicationRecord show all
Includes:
Models::Auditable
Defined in:
app/models/bank_balance_statement.rb

Overview

== Schema Information

Table name: bank_balance_statements
Database name: primary

id :integer not null, primary key
account_number :integer
amount :float
description :string
gl_date :date
created_at :datetime not null
updated_at :datetime not null
creator_id :integer
updater_id :integer

Indexes

index_bank_balance_statements_on_account_number (account_number)
index_bank_balance_statements_on_gl_date (gl_date)

Constant Summary

Constants included from Models::Auditable

Models::Auditable::ALWAYS_IGNORED

Class Method Summary collapse

Methods included from Models::Auditable

#all_skipped_columns, #audit_reference_data, #creator, #should_not_save_version, #stamp_record, #updater

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.sortedActiveRecord::Relation<BankBalanceStatement>

A relation of BankBalanceStatements that are sorted. Active Record Scope

Returns:

See Also:



24
# File 'app/models/bank_balance_statement.rb', line 24

scope :sorted, -> { order(:gl_date, :account_number)}

.with_account_nameActiveRecord::Relation<BankBalanceStatement>

A relation of BankBalanceStatements that are with account name. Active Record Scope

Returns:

See Also:



25
# File 'app/models/bank_balance_statement.rb', line 25

scope :with_account_name, -> { select("bank_balance_statements.*, (select name from ledger_accounts where ledger_accounts.number = bank_balance_statements.account_number) as account_name") }