[Nitro] [PATCH] Allow multiple joins_many style relationships between two classes (and relevent test case)

Rob Pitt rob at motionpath.com
Fri Feb 17 08:20:02 EST 2006

WARNING: This patch causes join tables to be created with different
names and will require you to manually copy join table data into newly
named tables if applied to a project you are already using.

Why would I make a patch that requires this? Not having this requirement
(i.e. doing it in an automated fashion) would be fairly complicated and
a big drain on CPU.

This patch still needs to be implemented at some point because it
enables a desirable behaviour, and we are at 0.2 so we should make
changes with big impacts like this now rather than later.

This is a very minor modification so that a model like this behaves as
it should:

Class Article
  property :title, String

  joins_many :first_join, Category
  joins_many :second_join, Category
  joins_many Category

  def initialize(title)
    @title = title

Without this patch, items you push into .first_join are visible
in .second_join and the .categories join (all other combinations of this
are also true).

This is wrong, and this patch corrects this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: join-tables.patch.bz2
Type: application/x-bzip
Size: 5499 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20060217/c9e8c33d/attachment.bin 

More information about the Nitro-general mailing list