Skip to content

Instantly share code, notes, and snippets.

@phirefly
Created June 10, 2010 21:30
Show Gist options
  • Save phirefly/433663 to your computer and use it in GitHub Desktop.
Save phirefly/433663 to your computer and use it in GitHub Desktop.
class ModelName
include MongoMapper::Document
key :key, String
timestamps!
# Validations :::::::::::::::::::::::::::::::::::::::::::::::::::::
# validates_presence_of :attribute
# Assocations :::::::::::::::::::::::::::::::::::::::::::::::::::::
# belongs_to :model
# many :model
# one :model
# Callbacks :::::::::::::::::::::::::::::::::::::::::::::::::::::::
# before_create :your_model_method
# after_create :your_model_method
# before_upate :your_model_method
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment