Adam Akhtar wrote:
> Thanks again.
> Ok i know why your saying to have a consistent sorting method, its so as 
> to avoid a duplicate situation i.e. if i always sort by the letter and 
> id then i will always save as ab and not ba. If theres already an ab 
> there and i have some validations i can avoid reading in another ab. 
> That bit i understand.

OK.

> 
> But the problem is i will only have, and ive tested this, a one way 
> relationship. That is 'A' is an "alphabet" which has an 
> "alphabet_partner" of 'b'.
> 
> I.e. a.alphabet_partner = b.
> 
> But that's the problem, 'B' is just an "alphabet_partner" in this 
> pairing table. There is nothing in the pairing table nor the 
> associations currently set that say b
> "B" is ALSO an "alphabet" which has an "alphabet_partner" of 'A'.
> i.e. b.alpahbet_partner == []. it will NOT yield 'A'

Then make another association.  Remember, you can have multiple 
independent associations between the same pair of tables.
> 
> I have tried this with my setup and thats the result i get but also 
> thinking about it makes me believe this can only be the end result.

With the setup you have, you're right.  But adding one more set of 
associations should solve that.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to