Projects |
If I want an attribute on my M-M relation (eg. a user in a religiouscult can be "Leader", "Trainee", "MCP".. or whatever you have stored in your "roles" table), what would be the proper Rails way of doing this? I still haven't found the time to take Rails for a whirl [1], so if there's a FAQ entry on this, I wouldn't know.. [1]: Oxymoron you say? :-) What tool do you use to draw those diagrams??? thanks Morten: Active Record supports Single Table Inheritance . So your Leader, Trainee, and so on with just subclass User and it would more or less "just work". Mikkel: They were drawn using OmniGraffle. Mikkel: I used omnigraffle to draw them. It's a pretty nice package for OSX. -Scott thanks.... ill check it out... David, I think Morten is talking about an attribute on the relationship. For example someone could be a "Leader" in one cult, and a "Security Guard" in another. I'm also interested in the recommended way of handling this in AR. Ahh, no. In that situation, you'd introduce a new object called Role. That would say Role belongs_to :user and Role belongs_to :cult. In the parlor of Domain-driven Design, you've now deepened the model and you're likely to find that both additional behavior and data fits well on the Role class. Gotcha. In past, I used a Role class (with belongs_to relationships) and also used it's table for has_and_belongs_to_many relationships between users and cults. Please check out some relevant pages in the field of custom poker chips custom poker chips http://www.juris-net.com/custom-poker-chips.html new york new york hotel and casino new york new york hotel and casino http://www.juris-net.com/new-york-new-york-hotel-and-casino.html slot machine game slot machine game http://www.juris-net.com/slot-machine-game.html gambling chips gambling chips http://www.juris-net.com/gambling-chips.html poker t shirt poker t shirt http://www.juris-net.com/poker-t-shirt.html play poker for free play poker for free http://www.juris-net.com/play-poker-for-free.html blackjack table plans blackjack table plans http://www.juris-net.com/blackjack-table-plans.html poker etiquette poker etiquette http://www.juris-net.com/poker-etiquette.html play blackjack online free play blackjack online free http://www.juris-net.com/play-blackjack-online-free.html las vegas slot tournaments las vegas slot tournaments http://www.juris-net.com/las-vegas-slot-tournaments.html free celebrity strip blackjack online free celebrity strip blackjack online http://www.juris-net.com/free-celebrity-strip-blackjack-online.html coin slot coin slot http://www.juris-net.com/coin-slot.html aristocrat slot machines aristocrat slot machines http://www.juris-net.com/aristocrat-slot-machines.html purchase slot machines purchase slot machines http://www.juris-net.com/purchase-slot-machines.html gambling casinos in tunica mississippi gambling casinos in tunica mississippi http://www.juris-net.com/gambling-casinos-in-tunica-mississippi.html games blackjack adult free games blackjack adult free http://www.juris-net.com/games-blackjack-adult-free.html northwood roulette northwood roulette http://www.juris-net.com/northwood-roulette.html online gambling best online gambling best http://www.juris-net.com/online-gambling-best.html legal gambling age in las vegas legal gambling age in las vegas http://www.juris-net.com/legal-gambling-age-in-las-vegas.html free roulette system perfect free roulette system perfect http://www.juris-net.com/free-roulette-system-perfect.html paragon roulette paragon roulette http://www.juris-net.com/paragon-roulette.html play online strip blackjack free play online strip blackjack free http://www.juris-net.com/play-online-strip-blackjack-free.html tips on playing roulette tips on playing roulette http://www.juris-net.com/tips-on-playing-roulette.html caveman keno online caveman keno online http://www.juris-net.com/caveman-keno-online.html craps cant lose strategy craps cant lose strategy http://www.juris-net.com/craps-cant-lose-strategy.html wildball keno wildball keno http://www.juris-net.com/wildball-keno.html blackjack 21 blackjack 21 http://www.juris-net.com/blackjack-21.html deluxe 52 blackjack table deluxe 52 blackjack table http://www.juris-net.com/deluxe-52-blackjack-table.html how to cheat at black jack how to cheat at black jack http://www.juris-net.com/how-to-cheat-at-black-jack.html aktuelle vortagespermanenz roulette aktuelle vortagespermanenz roulette http://www.juris-net.com/aktuelle-vortagespermanenz-roulette.html gen john black jack pershing gen john black jack pershing http://www.juris-net.com/gen-john-black-jack-pershing.html roulette wheel clocking roulette wheel clocking http://www.juris-net.com/roulette-wheel-clocking.html black jack poker rules black jack poker rules http://www.juris-net.com/black-jack-poker-rules.html free roulette stratergy free roulette stratergy http://www.juris-net.com/free-roulette-stratergy.html mass keno number results mass keno number results http://www.juris-net.com/mass-keno-number-results.html ... Hello. I am new here. It is very interesting. Sorry for my links Hello. I am new here. It is very interesting. Sorry for my links Hello. I am new here. It is very interesting. Hello. I am new here. It is very interesting. Hello. I am new here. It is very interesting. Hello. I am new here. It is very interesting. Hello. I am new here. It is very interesting. You may find it interesting to take a look at the pages about free poker free poker http://www.poker-adventure.com/free-poker.html ... In your free time, take a look at some relevant information in the field of internet casino internet casino http://www.scottishtutors.com/internet-casino.html . You are invited to take a look at some relevant information on world series of poker world series of poker http://www.uclaaud.org/world-series-of-poker.html poker table poker table http://www.uclaaud.org/poker-table.html world poker tour world poker tour http://www.uclaaud.org/world-poker-tour.html free poker games free poker games http://www.uclaaud.org/free-poker-games.html how to play poker how to play poker http://www.uclaaud.org/how-to-play-poker.html poker hand rankings poker hand rankings http://www.uclaaud.org/poker-hand-rankings.html celebrity poker celebrity poker http://www.uclaaud.org/celebrity-poker-.html - Tons of interesdting stuff!!! |