has_accounts 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/models/booking.rb +1 -1
- data/app/models/booking.rb~ +2 -2
- metadata +10 -5
data/app/models/booking.rb
CHANGED
@@ -64,7 +64,7 @@ class Booking < ActiveRecord::Base
|
|
64
64
|
rescue ArgumentError
|
65
65
|
end
|
66
66
|
|
67
|
-
where("title LIKE :text OR comments
|
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
|
data/app/models/booking.rb~
CHANGED
@@ -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(
|
35
|
-
scope :by_value_period, lambda {|from, to| where(
|
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
|
-
|
4
|
+
hash: 59
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
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-
|
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.
|
84
|
+
rubygems_version: 1.6.0
|
80
85
|
signing_key:
|
81
86
|
specification_version: 3
|
82
87
|
summary: HasAccounts provides models for financial accounting.
|