This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Sep 16 13:49:44 -0700 2009 | |
| |
MIT-LICENSE | Sat May 31 17:19:10 -0700 2008 | |
| |
README.markdown | Thu Sep 17 09:29:12 -0700 2009 | |
| |
Rakefile | Wed Sep 16 13:49:44 -0700 2009 | |
| |
init.rb | Sat May 31 17:19:10 -0700 2008 | |
| |
lib/ | Sun Nov 01 20:50:31 -0800 2009 | |
| |
test/ | Thu Sep 17 09:05:19 -0700 2009 |
README.markdown
Polymorphic Include
Eager loading of polymorphic associations doesn't work in Rails < 2.1 and only works in 2.1 if rails doesn't have to fall back on left outer joins for the :include.
This plugin allows eager loading in all situations in rails.
It assumes you are using the default "_type" suffix. With this code you can just use a :include directive in your finds and it will return your associations instead of throwing an exception.
Installation
To install as a rails plugin, use the script/plugin command with rails >= 2.0
./script/plugin install git://github.com/haruska/polymorphic_include.git
For rails < 2.0, install it by hand
cd vendor/plugins
git clone git://github.com/haruska/polymorphic_include.git
Example Usage
class Address < ActiveRecord::Base
belongs_to :addressable, :polymorphic => true
end
# A call that tries to eager load the addressable model
Address.find(:all, :include => :addressable)
Copyright (c) 2008-2009 Jason Haruska, released under the MIT license







