2011-11-18 08:43:14 +00:00
|
|
|
class Post
|
|
|
|
include Mongoid::Document
|
|
|
|
include Mongoid::Timestamps
|
|
|
|
field :title, :type => String
|
|
|
|
field :body, :type => String
|
|
|
|
embeds_many :comments
|
|
|
|
validates_presence_of :title, :body
|
2012-02-07 08:16:48 +00:00
|
|
|
has_one :object_auth,as: :obj_authable,dependent: :delete
|
2011-11-18 08:43:14 +00:00
|
|
|
end
|