payday 1.0.0beta3 → 1.0.0beta4

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/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
@@ -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?
@@ -2,5 +2,5 @@
2
2
  module Payday
3
3
 
4
4
  # Current Version
5
- VERSION = "1.0.0beta3"
5
+ VERSION = "1.0.0beta4"
6
6
  end
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
@@ -1,6 +1,8 @@
1
1
  require File.join(File.dirname(__FILE__), "..", "lib", "payday")
2
2
 
3
3
  require 'test/unit'
4
+ require 'date'
5
+ require 'time'
4
6
 
5
7
  # Shamelessly ripped from jm's context library: https://github.com/jm/context/blob/master/lib/context/test.rb
6
8
  class Test::Unit::TestCase
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: 62196357
4
+ hash: 62196363
5
5
  prerelease: 5
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 3
12
- version: 1.0.0beta3
11
+ - 4
12
+ version: 1.0.0beta4
13
13
  platform: ruby
14
14
  authors:
15
15
  - Alan Johnson