This project is archived and is in readonly mode.
Can't create AR models with custom updated_xx timestamp.
Reported by Luis Hurtado | December 22nd, 2008 @ 12:12 AM | in 2.x
When creating ActiveRecord objects with custom date/time for updated_at or updated_on attributes, custom value is ignored and use current time instead. Example:
custom_time = 1.hour.ago.beginning_of_day
forum = Forum.create(:title => "The Colombian Forum", :updated_at => custom_time)
Currently it is possible to create ActiveRecord objects with custom created_at or created_on attributes.
Comments and changes to this ticket
-
Pratik December 22nd, 2008 @ 03:47 AM
- Assigned user set to Pratik
- State changed from new to incomplete
Looks good to me. I think it should be possible to make use of existing tables though, instead of creating new tables.
Thanks.
-
Luis Hurtado December 22nd, 2008 @ 02:52 PM
Agree. New diff uses already existent "parrots" table and also groups 4 tests in 1.
-
Pratik December 22nd, 2008 @ 02:54 PM
- State changed from incomplete to open
-
Pratik December 22nd, 2008 @ 03:57 PM
- State changed from open to resolved
Fixed in http://github.com/rails/rails/co...
-
James B. Byrne January 27th, 2009 @ 12:24 AM
Q: Is it really intended that the created_at value can be overridden and set to any arbitrary date and time? Does that not negate the entire purpose of the feature in AR? I would think that rather than allowing updated_at to be similarly abused the real fix is to check to see if the current row is new and not whether the attribute created_at is already set.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>