views:

8

answers:

0

I need to get populator to build me an order history such that:

  • The record has a start_date and end_date
  • Each record specifies a period between 0 and 5 years
  • Events are pretty much consecutive (meaning the end date of record n affects the start date of record n+1)
  • There can be gaps between events (periods of no orders) but no overlaps

How would you build this in populator so each of the 0..10 records form a natural and imperfect chain?

Order.populate 0..10 do |c|
  c.date_end = 
  c.date_start =
end