Я использовал следующий код для генерации 3 макетов:
# today is 27.02
order1 = Factory(:order, :created_at => Date.yesterday) # created_all is 25.02?
order2 = Factory(:order, :quantity => 2, :created_at => Date.today) # created_all is 26.02??
order3 = Factory(:order, :created_at => Date.today) # created_all is 26.02???
Для правильной установки даты я использую:
order1 = Factory(:order, :created_at => 1.days.ago)
order2 = Factory(:order, :quantity => 2, :created_at => Time.now)
order3 = Factory(:order, :created_at => Time.now)
Любая идея, что такое разница междуDate.today и Time.now?
Спасибо,