Attribute time field coercion

233 views
Skip to first unread message

Carson Baker

unread,
Feb 25, 2010, 6:15:33 PM2/25/10
to Mongoid
Hallo,

In my model I have:

field :ending_at, :type => Time

When trying to set this field via a form submission that uses a
datetime_select, the value is nil. It seems there's some time coercion
magic in ActiveRecord that's not present in Mongoid. Aside from
writing my own serializer in my controller, how should I approach a
solution here?

Best,
Carson

Durran Jordan

unread,
Feb 25, 2010, 7:14:49 PM2/25/10
to mon...@googlegroups.com
Right now mongoid doesnt support multi parameter attributes, like the rails helpers provide... A quick workaround for you until I pull it in:

http://gist.github.com/315227
Reply all
Reply to author
Forward
0 new messages