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

DateTime fields not receiving attributes from datetime_select

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

      Whenever I use a datetime_select tag in my view, I get this error in my tests

      Mongoid::Errors::UnknownAttribute:

      Problem:
      Attempted to set a value for 'fromtime(1i)' which is not allowed on the model Event.
      Summary:
      Without including Mongoid::Attributes::Dynamic in your model and the attribute does not already exist in the attributes hash, attempting to call Event#fromtime(1i)= for it is not allowed. This is also triggered by passing the attribute to any method that accepts an attributes hash, and is raised instead of getting a NoMethodError.
      Resolution:
      You can include Mongoid::Attributes::Dynamic if you expect to be writing values for undefined fields often.

      This issue was previously addressed here : https://github.com/mongoid/mongoid/issues/2954

      However, I don't see any actual fix that will allow me to use the datetime_select tag.

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

              Created:
              Updated:
              Resolved: