You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bangal...@googlegroups.com
Hi,
I am trying to store a list of interconnected graph nodes using active records in rails. For this I am using Has and Belongs to Many association for my node. The problem is that in the join table I wish to store the weight of the edge between the two nodes as well. That in itself is not an issue as I can add an extra column in the join table. But how do I access (read/write) this column from my nodes model?
Any good ideas?
-Mayank
Amit Mathur
unread,
Nov 7, 2009, 1:20:23 PM11/7/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bangal...@googlegroups.com
Hi Mayank,
In general, if you need to put attributes on the join table, i.e. want to make join table a model, you should use has_many :through associations in place of HABTM.
HTH.
Regards, Amit.
Mayank Sharma
unread,
Nov 7, 2009, 2:57:51 PM11/7/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bangal...@googlegroups.com
Thanks Amit, got it working. amazed by how simple the solution was. I was not thinking beyond HABTM