Orbit/vendor/built_in_modules/NewBlog/app/models/post.rb

8 lines
197 B
Ruby

class Post
include Mongoid::Document
include Mongoid::Timestamps
field :title, :type => String
field :body, :type => String
embeds_many :comments
validates_presence_of :title, :body
end