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
16 17 18 |
# File 'lib/keepr/group.rb', line 16 def self.result where(:is_result => true).first end |
Instance Method Details
#keepr_postings ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/keepr/group.rb', line 20 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(self.subtree) end end |