constantcontact/composite_primary_keys — pull request #4 by strmpnk (2013-01-17 16:36:13+00:00)
Title: Optimize ActiveRecord::Relation Patching

I've replaced the singleton class operations called within initialize with a subclass and a simple branch in `new`. This should help a lot with type sensitive platforms like JRuby which fail to JIT such polymorphic code.

The patch attempts to be self contained changes and as such it's rather hard to make it much cleaner but it seems to work in real applications I've tested. One caveat is that we now have a single failing test. This doesn't seem to affect any applications I checked but it will likely be worth following up on before pushing this completely upstream.