I have the following:
class Email
include ::Mongoid::Timestamps
include ::Mongoid::Document
field :email_address, :type => String
field :user_id, :type => Integer
field :campaign, :type => String
field :stream, :type => String
field :component, :type => String
embeds_many :actions
end
And rails is complaining it can’t find the field method definition.
Does anyone one know why?
You must include
Mongoid::TimestampsafterMongoid::Document.