Sha256: f5040d671e790b34f26fd05ee31c0c66b1184d3c74bae77a44be73379b507451

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

module ActsAsAccount
  class Posting < ActiveRecord::Base
    set_table_name :acts_as_account_postings
    
    belongs_to :account, :class_name => 'ActsAsAccount::Account'
    belongs_to :other_account, :class_name => 'ActsAsAccount::Account'
    belongs_to :journal, :class_name => 'ActsAsAccount::Journal'
    belongs_to :reference, :polymorphic => true
    
    named_scope :soll,  :conditions => 'amount >= 0'
    named_scope :haben, :conditions => 'amount < 0'
    named_scope :start_date,  lambda{|date| {:conditions => ['DATE(valuta) >= ?', date]}}
    named_scope :end_date,    lambda{|date| {:conditions => ['DATE(valuta) <= ?', date]}}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_account-1.2.0 lib/acts_as_account/posting.rb