
dm-timestamps should serialise DateTime to higher accuracy/use Time
Reported by Ashley Moran | June 29th, 2009 @ 04:01 PM
DataMapper dm-timestamps currently serialises DateTime to a 1s resolution, which is not precise enough to make specs than run at an acceptable speed. Currently I'm doing this to force a workaround:
DataMapper::Timestamp::TIMESTAMP_PROPERTIES = {
:updated_at => [ Time, lambda { |r, p| Time.now } ],
:updated_on => [ Date, lambda { |r, p| Date.today } ],
:created_at => [ Time, lambda { |r, p| r.created_at || (Time.now if r.new_record?) } ],
:created_on => [ Date, lambda { |r, p| r.created_on || (Date.today if r.new_record?) } ],
}.freeze
After a discussion on the mailing list[1], it appears some people may experience issues with this implementation. (It currently works fine for me.)
The current situation is that this ticket should be reviewed after the refactoring of DM::Property.
[1] http://groups.google.com/group/datamapper/browse_thread/thread/f104...
Comments and changes to this ticket
-
Dan Kubb (dkubb) July 3rd, 2009 @ 03:02 AM
- State changed from new to unconfirmed
- Milestone changed from 0.10.0 to 0.10.1
-
Dan Kubb (dkubb) July 22nd, 2009 @ 03:31 PM
- State changed from unconfirmed to suggestion
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.1 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" not-tagged:"0.10.1" milestone:id#51895 bulk edit command]
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:41 PM
- Milestone cleared.
-
Piotr Solnica (solnic) May 17th, 2011 @ 02:33 AM
- Tag set to dm-timestamp
-
Piotr Solnica (solnic) May 17th, 2011 @ 03:58 AM
- Tag changed from dm-timestamp to dm-timestamps
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »