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

8 lines
197 B
Ruby
Raw Normal View History

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