Sha256: c4955772f6c7bebb8b9ed0a97c792d667178ce49dbe1c74db407cfc869323761

Contents?: true

Size: 475 Bytes

Versions: 11

Compression:

Stored size: 475 Bytes

Contents

module Hicube
  class Content

    include Mongoid::Document
    include Mongoid::Timestamps
    include Mongoid::Slug

    #
    # Slugs
    #
    slug              :name

    #
    # Relations
    #
    embedded_in :page, class_name: 'Hicube::Page'

    field :name, type: String
    field :body, type: String
    field :head, type: Boolean, default: false

    validates_presence_of :name
    validates_uniqueness_of :name

    def to_s
      self.name
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hicube-0.0.11 app/models/hicube/content.rb
hicube-0.0.10 app/models/hicube/content.rb
hicube-0.0.9 app/models/hicube/content.rb
hicube-0.0.8 app/models/hicube/content.rb
hicube-0.0.7 app/models/hicube/content.rb
hicube-0.0.6 app/models/hicube/content.rb
hicube-0.0.5 app/models/hicube/content.rb
hicube-0.0.4 app/models/hicube/content.rb
hicube-0.0.3 app/models/hicube/content.rb
hicube-0.0.2 app/models/hicube/content.rb
hicube-0.0.1 app/models/hicube/content.rb