Sha256: 003560ad0c6f11ee9086aaa2b5f0632d115a8e08fa317d6baf66508dd45abcb2

Contents?: true

Size: 391 Bytes

Versions: 1

Compression:

Stored size: 391 Bytes

Contents

class Bill
  dummy :account

  dummy :order_date do
    Date.today.advance(:days => rand(-365))
  end

  dummy :due_date, :only => :overdue do |bill|
    date = bill.order_date.advance(:days => 90)

    (date >= Date.today) ? Date.today.advance(:days => -1) : date
  end

  dummy :only => :with_items, :after => :save do |bill|
    5.times do
      bill.items.create_dummy
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
test_dummy-0.5.0 test/dummy/bill.rb