Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

updated_at value isn't set properly

#135

Let's say you want to test a method returning only items saved before today.

scenario :posts do

%w( title1 title2 ).each do |title|

Post.create! :title => title, :updated_at => Date.today -1

end

end

the updated_at value won't be set properly.

Reported by Matt Aimonetti · October 18th, 2007 @ 01:59 PM

State: hold
Milestone: none
Assigned to: Chris Wanstrath Chris Wanstrath

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to hold

    Right now you can accomplish this with Model.record_timestamps = false. Maybe I should add a :timestamps => false option to the scenario method? What do you think?

    October 29th, 2007 @ 01:10 PM

  2. Matt Aimonetti (mattetti)
    Matt Aimonetti (mattetti)

    I didn't try your code against the latest trunk changes to fixtures (rathole got merged in core).

    However if it's still compatible, I would definitely suggest to add an option to the scenario method.

    November 8th, 2007 @ 06:34 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.