Sha256: 5ab64e07c1009eeb478274bf267628d7de61b73198bc565d40bf19595d906d4e
Contents?: true
Size: 646 Bytes
Versions: 5
Compression:
Stored size: 646 Bytes
Contents
class Article include Mongoid::Document include Mongoid::Timestamps include Mongoid::Paranoia include Mongoid::Versioning include Mongoid::MultiParameterAttributes field :title field :content field :published, :type => Boolean, :default => false field :allow_comments, :type => Boolean, :default => true embeds_many :comments embeds_one :permalink belongs_to :author, :class_name => 'User', :inverse_of => :articles, :index => true validates :title, :presence => true validates_length_of :title, :minimum => 8, :maximum => 16 index({ title: 1 }, { unique: true, background: true }) index({ published: 1 }) end
Version data entries
5 entries across 5 versions & 1 rubygems