Skip to content

Instantly share code, notes, and snippets.

@ngw
Created January 22, 2011 09:09
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 ngw/791001 to your computer and use it in GitHub Desktop.
Save ngw/791001 to your computer and use it in GitHub Desktop.
class Question
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Slug
attr_protected :_id
field :text, :type => String
field :detail, :type => String
field :created_at, :type => DateTime
field :updated_at, :type => DateTime
slug :text
referenced_in :user
references_and_referenced_in_many :followers, :class_name => 'User', :inverse_of => :followings
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment