-
Type: Task
-
Resolution: Done
-
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.