search for: relatioship

Displaying 4 results from an estimated 4 matches for "relatioship".

Did you mean: relationship
2006 Apr 20
2
table that have many-to-may relationship to itself
In a social netowrk data model, users belongs other users, and can have many friends as users, so it is a many to many relatioship. the class definition could be class User < ApplicationController has_mang_ang_belongs_to users But how it looks like in the mysql database tables in a "joined" users table. The question really is: what is the table looks like when a model has many and belongs itself. thx...
2007 Oct 19
1
Managing a lopsided has_and_belongs_to_many relationship
...housand Things, and a User base that may grow to who knows how big (we can only hope ,right?) Users have and belong to many Things. I want to display a list of top Things, based on how many users each has. Things with 0 users are not displayed. Two questions. First, I expect the density of the relatioships to focus on a small percentage of the things. So while I may have 10,000 of them, it might be true that only 100 have at least 1 user. In doing my find statements, what would the syntax be to say "I am only interested in Things where users.size > 0"? I''m hoping that I odn&...
2006 Nov 02
4
Still Having Problems With :through When Going To Same Table... Help... please :-(
I am having a problem with doing a :through that goes back to the same table. The following are my two classes: >>>>> class User < ActiveRecord::Base has_many :spanks has_many :spanked, :through => :spanks, :source => :spanked_user has_many :was_spanked_by, :through => :spanks, :source => :user end class Spank < ActiveRecord::Base belongs_to :spanker,
2006 Aug 16
0
2 models with multiple relationships
...ng to make sure that none of the lovely Rails features override each other. I already made a join model for SavedProperty, and the relationship with the listing manager could be joined through a table that lists the counties. My main question is: could I be doing something better to make these relatioships seemless? Should I use single-table-inheritance with the User in order to give users specific roles (even though sellers and managers need to have all the same priviliges as buyers, so it could end up conflicting that way too). Thanks for all your help. Timothy Johnson www.foundinteractive.co...