Skip to content

Commit

Permalink
Fix date issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioelia committed Jan 25, 2013
1 parent 8fba602 commit d0c7699
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/plutus/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Account < ActiveRecord::Base
attr_accessible :name, :contra
attr_accessor :start_date, :end_date

has_many :credit_amounts, :include => :transaction, :conditions => proc { "plutus_transactions.date >= '#{start_date || "1900-01-01"}' AND plutus_transactions.date <= #{end_date || ( Date.today + 15.days ).to_s}" }
has_many :debit_amounts, :include => :transaction, :conditions => proc { "plutus_transactions.date >= '#{start_date || "1900-01-01"}' AND plutus_transactions.date <= #{end_date || ( Date.today + 15.days ).to_s}"
has_many :credit_amounts, :include => :transaction, :conditions => proc { "plutus_transactions.date >= '#{start_date || "1900-01-01"}' AND DATE( plutus_transactions.date) <= #{end_date || ( Date.today + 15.days ).to_s}" }
has_many :debit_amounts, :include => :transaction, :conditions => proc { "plutus_transactions.date >= '#{start_date || "1900-01-01"}' AND DATE( plutus_transactions.date ) <= #{end_date || ( Date.today + 15.days ).to_s}" }
has_many :credit_transactions, :through => :credit_amounts, :source => :transaction
has_many :debit_transactions, :through => :debit_amounts, :source => :transaction
belongs_to :accountable, :polymorphic => true
Expand Down

0 comments on commit d0c7699

Please sign in to comment.