DateTime with MongoDB/Mongoid and Rails 3 Not Populating

前端 未结 2 1702
广开言路
广开言路 2021-02-04 08:08

Here is the code in my Model

 include Mongoid::Document
 include Mongoid::Timestamps

 field :message, :type => String
 field :send_at, :type => DateTime
<         


        
2条回答
  •  情话喂你
    2021-02-04 08:23

    Recent versions of Mongoid do handle multi-parameter attributes, you just have to include the module in your model:

    include Mongoid::MultiParameterAttributes
    

    Docs: http://mongoid.org/en/mongoid/docs/rails.html

提交回复
热议问题