This project is archived and is in readonly mode.
Add special AssociationReflection methods for creating association objects
Reported by Hongli Lai | September 6th, 2008 @ 06:45 PM
This patch adds special AssociationReflection methods for creating association objects, and modifies the code base to use those methods instead of creating association objects directly. This allows plugins to hook into association object creation behavior.
For example,
@reflection.klass.new(...)
now becomes
@reflection.build_association(...)
Is this patch simple enough to make it into 2.2?
Comments and changes to this ticket
-
Hongli Lai September 9th, 2008 @ 07:34 PM
Here's the context: I'm building a plugin which adds sharding support to ActiveRecord. Suppose that there are multiple database shards. Upon creating a new association record, I want the association record to be saved into the correct database shard. And to do this I need to be able to hook into association record creation.
-
Jeremy Kemper September 9th, 2008 @ 09:11 PM
- State changed from new to open
- Milestone cleared.
-
Jeremy Kemper September 9th, 2008 @ 09:39 PM
- State changed from open to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>