Class: Keepr::Group
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Keepr::Group
- Defined in:
- lib/keepr/group.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.result ⇒ Object
18 19 20 |
# File 'lib/keepr/group.rb', line 18 def self.result where(is_result: true).first end |
Instance Method Details
#keepr_postings ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/keepr/group.rb', line 22 def keepr_postings if is_result Keepr::Posting .joins(:keepr_account) .where(keepr_accounts: { kind: [ Keepr::Account.kinds[:revenue], Keepr::Account.kinds[:expense] ] }) else Keepr::Posting .joins(keepr_account: :keepr_group) .merge(subtree) end end |