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

Allow Serialization of Elements in Array Fields.

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

      I believe there was a regression when applying this commit. As of now, DateTime fields can still be initialized as before, but can no longer be updated, even when manually converting Time value to UTC.

      class TestDate
      include Mongoid::Document
      field :some_date_time, :type => DateTime
      end
      > new_date = TestDate.create(:some_date_time => 1.day.ago)
      > true
      > new_date.update_attribute(:some_date_time, 2.days.ago)
      > BSON::InvalidDocument: DateTime is not currently supported; use a UTC Time instance instead.
      > new_date.update_attribute(:some_date_time, 2.days.ago.utc)
      > BSON::InvalidDocument: DateTime is not currently supported; use a UTC Time instance instead.
      > new_date.update_attribute(:some_date_time, Time.now)
      > BSON::InvalidDocument: DateTime is not currently supported; use a UTC Time instance instead.

            Assignee:
            Unassigned Unassigned
            Reporter:
            angelim angelim
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: