I used the code from Jeremy.
Okay, so the problem is this
=> NoMethodError: undefined method `position' for #<Child:0xb76b4114>
Which is right, Child has not position attribute it's in the ChildrenParent.
Now the problem is that a child has_many children_parents, so we can't just do
We need to say WHICH of the many possible childrenParents we're
talking about, Now I'm guessing that the logic actually dictates that
there really is only one, in which case we can do
However the right way to do this, IMHO would be to do this:
But of course this raises the question of why position isn't just a
simple attribute of Child, in which case I'd seriously consider
dropping back to HABTM.
If there really are multiple ChildrenParents associated with a single
Child, then you do need to figure out which one you are getting the