Skip to content

Instantly share code, notes, and snippets.

@jakubstraka
Created January 20, 2015 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakubstraka/b6865770ce4c12ab1ca3 to your computer and use it in GitHub Desktop.
Save jakubstraka/b6865770ce4c12ab1ca3 to your computer and use it in GitHub Desktop.
Page.rb
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
@tomasc
Copy link

tomasc commented Jan 20, 2015

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