Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2372

Atomic persistence operations can't save datetimes

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.6
    • Affects Version/s: None
    • Component/s: None

      This passes:

            datum = DateTime.now
            visitor.update_attributes(last_page_view: datum)
            visitor.last_page_view.utc.to_s.should == datum.utc.to_s
      

      But,

            datum = DateTime.now
            visitor.set(:last_page_view, datum)
            visitor.last_page_view.utc.to_s.should == datum.utc.to_s
      

      This returns

      NoMethodError:
      undefined method `bson_dump' for Fri, 07 Sep 2012 09:28:46 +0200:DateTime

      Same thing happens with find_and_modify.

            Assignee:
            durran Durran Jordan
            Reporter:
            dbulic dbulic
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: