Forum: Ruby on Rails What happened to the (dynamic) fixtures?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
04e1b6bf268d6110f4ca25201186f726?d=identicon&s=25 Xdmx Xdmx (xdmx)
on 2008-11-30 20:19
Hi, i've a fixture with some ruby code, something like this:

first:
  attr1: text
  attr2: <%= 3.days.ago %>



But now the <&= 3.days.ago %> doesn't return anymore the correct value,
but nil.
What happened? How can i put some dynamic text into the fixtures like N
days ago ?
Thanks
04e1b6bf268d6110f4ca25201186f726?d=identicon&s=25 Xdmx Xdmx (xdmx)
on 2008-11-30 20:46
Found, it's kind a bug.. with a datetime attribute in the fixture the
value must converted to the db format (to_s(:db)), otherwise a simple
Time.now would return nil
This topic is locked and can not be replied to.