Skip to content

Instantly share code, notes, and snippets.

@jcoene
Created August 8, 2010 03:03
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 jcoene/513522 to your computer and use it in GitHub Desktop.
Save jcoene/513522 to your computer and use it in GitHub Desktop.
require 'rubygems'
puts ENV["GEM_HOME"]
require 'mongoid'
require 'mongoid/version'
class RapSupahStah
include Mongoid::Document
cache
attr_accessor :mode
field :mode
field :value
after_initialize :my_after_initialize_callback
def my_after_initialize_callback
puts "after_initialize"
puts "Using Mongoid: #{Mongoid::VERSION}"
self.mode ||= "balla"
end
def initialize(attributes={})
puts "initialize"
puts "Using Mongoid: #{Mongoid::VERSION}"
super
self.mode ||= "pimp"
end
end
mongo_money = RapSupahStah.new
puts mongo_money.mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment