Created
January 20, 2015 06:53
-
-
Save jakubstraka/b6865770ce4c12ab1ca3 to your computer and use it in GitHub Desktop.
Page.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Page | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
include Mongoid::Userstamp | |
include Mongoid::Slug | |
include MongoidVersioning::Versioned | |
include Mongoid::Ancestry | |
has_ancestry | |
# --------------------------------------------------------------------- | |
# Concerns | |
include Position | |
include Visible | |
# --------------------------------------------------------------------- | |
# Fields | |
field :name, type: String | |
slug :name | |
# --------------------------------------------------------------------- | |
# Validations | |
validates_presence_of :name | |
# --------------------------------------------------------------------- | |
# Relations | |
embeds_many :content_blocks | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class Page
include Mongoid::Document
include Mongoid::Timestamps
#include Mongoid::Userstamp
#include Mongoid::Slug
#include MongoidVersioning::Versioned
#include Mongoid::Ancestry
#has_ancestry
---------------------------------------------------------------------
Concerns
#include Position
#include Visible
---------------------------------------------------------------------
Fields
field :name, type: String
slug :name
---------------------------------------------------------------------
Validations
validates_presence_of :name
---------------------------------------------------------------------
Relations
embeds_many :content_blocks
end