Skip to content

Instantly share code, notes, and snippets.

@yannski
Created June 18, 2010 15:14
Show Gist options
  • Save yannski/443765 to your computer and use it in GitHub Desktop.
Save yannski/443765 to your computer and use it in GitHub Desktop.
Person
.where(:last_name => "Zorg")
.and(:middle_initial => "J")
.and(:age.gt => 30)
class Player
include Mongoid::Document
include Mongoid::Versioning
field :status
scope :inactive,
:where => { :active => false }
before_create :do_something
after_destroy :do_something_else
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment