has_accounts 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -64,7 +64,7 @@ class Booking < ActiveRecord::Base
64
64
  rescue ArgumentError
65
65
  end
66
66
 
67
- where("title LIKE :text OR comments = :text OR amount = :amount OR value_date = :value_date", :text => text, :amount => amount, :value_date => date)
67
+ where("title LIKE :text OR comments LIKE :text OR amount = :amount OR value_date = :value_date", :text => text, :amount => amount, :value_date => date)
68
68
  }
69
69
 
70
70
  # Returns array of all years we have bookings for
@@ -31,8 +31,8 @@ class Booking < ActiveRecord::Base
31
31
  # Scoping
32
32
  default_scope order('value_date, id')
33
33
 
34
- scope :by_value_date, lambda {|value_date| where(:value_date => value_date) }
35
- scope :by_value_period, lambda {|from, to| where(:value_date => (from..to)) }
34
+ scope :by_value_date, lambda {|value_date| where("date(value_date) = ?", value_date) }
35
+ scope :by_value_period, lambda {|from, to| where("date(value_date) BETWEEN :from AND :to", :from => from, :to => to) }
36
36
 
37
37
  scope :by_account, lambda {|account_id|
38
38
  { :conditions => ["debit_account_id = :account_id OR credit_account_id = :account_id", {:account_id => account_id}] }
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_accounts
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 59
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 8
8
- - 1
9
- version: 0.8.1
9
+ - 2
10
+ version: 0.8.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-05-02 00:00:00 +02:00
18
+ date: 2011-05-17 00:00:00 +02:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -60,23 +61,27 @@ rdoc_options: []
60
61
  require_paths:
61
62
  - lib
62
63
  required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
63
65
  requirements:
64
66
  - - ">="
65
67
  - !ruby/object:Gem::Version
68
+ hash: 3
66
69
  segments:
67
70
  - 0
68
71
  version: "0"
69
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
70
74
  requirements:
71
75
  - - ">="
72
76
  - !ruby/object:Gem::Version
77
+ hash: 3
73
78
  segments:
74
79
  - 0
75
80
  version: "0"
76
81
  requirements: []
77
82
 
78
83
  rubyforge_project:
79
- rubygems_version: 1.3.6
84
+ rubygems_version: 1.6.0
80
85
  signing_key:
81
86
  specification_version: 3
82
87
  summary: HasAccounts provides models for financial accounting.