I have two types of models which I’m not sure how to model (or if it’s
feasible) with ActiveRecord. Let me know if you’ve got any good ideas.
For those of you who are familliar with del.icio.us, you probably
that you can bookmark a site, and add your own tags to it. Each person
their own tags for a site, even though multiple people can bookmark a
How would you create that relationship in ActiveRecord?
user has many websites (easy)
BUT… there’s no relation between tags and websites, or users and
It’s like a 3-way user-tag-website relationship. “Every user-website
has many tags”. How do you model that one? Easy enough to do in a
relational db, but I can’t get my head around it with Active Record.
This one may be easier, but I still can’t get it… kinda similar to
Let’s say a user can bookmark a website, and can also “rank” that
Unlike the example above, all I really want to do is assign an attribute
the user-website relationship (ie add a field to the users_websites
“every user-website pair has one rank”. Again - is this one possible?
Many thanks for any advice you can give. I know these relationships are
somewhat complext, just wondering how far I can take ActiveRecord before
dropping into straight SQL.