I have a small site that sorts news by the date it was sent to the second. Locally this works fine. Even with quick posting of stories in the line, there is a difference in the timestamp.
Example:
Submitted Fri Mar 25 14:31:09 2011 Submitted Fri Mar 25 14:30:45 2011 Submitted Fri Mar 25 14:30:23 2011
However, as soon as the code is clicked on the hero and the database is configured with MongoHQ, the value of seconds seems ignored or frozen.
Example Document Value DateTime:
added_on 03/14/2011 09:58 AM
Example timestamps:
Submitted Thu Mar 24 13:48:40 2011 Submitted Thu Mar 24 13:48:40 2011 Submitted Thu Mar 24 13:48:40 2011 Submitted Thu Mar 24 13:48:40 2011
Seems like seconds value is not updating?
Here is the model code,
class Post include Mongoid::Document field :link field :title field :synopsis field :added_on, :type => DateTime, :default => DateTime.now field :poster field :category validates_presence_of :link validates_presence_of :title validates_presence_of :synopsis validates_presence_of :category validates_uniqueness_of :link validates_uniqueness_of :title embeds_many :replies #referenced_in :topic end
source share