Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
simple identity map for active record. eager loading associations FTL
Ruby
branch: master

add #destroy support

git-svn-id: http://svn.techno-weenie.net/projects/plugins/active_record_context@3040 567b1171-46fb-0310-a4c9-b4bef9110e78
latest commit 65ba031b72
technoweenie authored
Failed to load latest commit information.
lib/technoweenie
test
README add logging
Rakefile add active_record_context plugin
init.rb add support for reload

README

ActiveRecordContext
===================

Simple ActiveRecord context for caching AR objects.  It caches all records from #find queries
that aren't readonly, and that don't have eagerly loaded associations. It only looks in the context
on simple Foo.find(id) queries with no conditions.  It's designed to work as an alternative to eager
loading associations.  It will also help all the extra find calls for models that access their associations
in callbacks/validations.

It only uses the context when it's activated.  To activate, you can set a controller around_filter:

  around_filter :set_context
  
  def set_context
    ActiveRecord::Base.with_context do
      yield
    end
  end
  
Set Technoweenie::ActiveRecordContext.log_context_activity = true to turn on debug logging.
Something went wrong with that request. Please try again.