Created
August 8, 2010 03:03
-
-
Save jcoene/513522 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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