ContextMonitor
===========

This plugin provides the capability for monitoring operations (create/update).

Example
=======

  ActiveRecord::Schema.define(:version => 0) do
    create_table :articles do |t|
      t.string  :name
      t.integer :created_by_id
      t.integer :updated_by_id
      t.timestamps
    end
  end

  class Article < ActiveRecord::Base
    context_monitor :user, :suffix => 'by'
  end

  User.current = User.find(10)
  article = Article.create!(:name => 'example')
  p article.created_by.id # 10
  p article.updated_by.id # 10
  p article.created_by == User.current # true
  p article.updated_by == User.current # true

  User.current = User.find(20)
  article.name = 'test'
  p article.created_by.id # 10
  p article.updated_by.id # 20
  p article.created_by == User.current # false
  p article.updated_by == User.current # true


Copyright (c) 2008 Good-Day, Inc
