payday 1.0.0beta3 → 1.0.0beta4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/payday/invoiceable.rb +1 -1
- data/lib/payday/version.rb +1 -1
- data/test/invoice_test.rb +5 -0
- data/test/test_helper.rb +2 -0
- metadata +3 -3
data/README.md
CHANGED
@@ -51,7 +51,7 @@ In a new migration:
|
|
51
51
|
create_table :invoices do |t|
|
52
52
|
# invoices will work without anything but bill_to, but there are quite a few options for the fields you can save, like ship_to
|
53
53
|
# due_at, and paid_at
|
54
|
-
t.string bill_to
|
54
|
+
t.string :bill_to
|
55
55
|
|
56
56
|
t.timestamps
|
57
57
|
end
|
data/lib/payday/invoiceable.rb
CHANGED
@@ -41,7 +41,7 @@ module Payday::Invoiceable
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def overdue?
|
44
|
-
defined?(:due_at) && ((due_at.is_a?(Date) && due_at < Date.today) || (due_at.is_a?(Time) < Time.now)) && !paid_at
|
44
|
+
defined?(:due_at) && ((due_at.is_a?(Date) && due_at < Date.today) || (due_at.is_a?(Time) && due_at < Time.now)) && !paid_at
|
45
45
|
end
|
46
46
|
|
47
47
|
def paid?
|
data/lib/payday/version.rb
CHANGED
data/test/invoice_test.rb
CHANGED
@@ -71,6 +71,11 @@ module Payday
|
|
71
71
|
assert !i.overdue?
|
72
72
|
end
|
73
73
|
|
74
|
+
test "overdue? when due_at is a time" do
|
75
|
+
i = Invoice.new(:due_at => Time.parse("Jan 1 14:33:20 GMT 2011"))
|
76
|
+
assert i.overdue?
|
77
|
+
end
|
78
|
+
|
74
79
|
test "paid is false when not paid" do
|
75
80
|
i = Invoice.new
|
76
81
|
assert !i.paid?
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196363
|
5
5
|
prerelease: 5
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 1.0.
|
11
|
+
- 4
|
12
|
+
version: 1.0.0beta4
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Alan Johnson
|