Skip to content

Instantly share code, notes, and snippets.

View whereisciao's full-sized avatar

Steven Chau whereisciao

  • Maxwell
  • Seattle, WA
View GitHub Profile
@whereisciao
whereisciao / mongoid.rb
Created February 10, 2011 15:34 — forked from outoftime/observing.rb
Mongoid Observer using ActiveModel.
require "#{RAILS_ROOT}/lib/mongoid/lib/observing.rb"
# Initializer for Observers
User.observers = :user_observer
User.instantiate_observers
# The preferred syntax, similar to AR's setup
# Mongoid.configure do |config|
# config.observers = :user_observer