Displaying 1 result from an estimated 1 matches for "userteam".
Did you mean:
usernam
2010 Jan 25
0
has_many, :finder_sql, setting attributes
...class UserProgram < ActiveRecord::Base
belongs_to :user
belongs_to :program
has_many :user_teams
has_many :teams, :through => :user_teams
end
class Program < ActiveRecord::Base
has_many :teams
has_many :user_programs
has_many :users, :through => :user_programs
end
class UserTeam < ActiveRecord::Base
belongs_to :user_program
belongs_to :team
end
class Team < ActiveRecord::Base
belongs_to :program
has_many :user_teams
has_many :users, :finder_sql => ''SELECT u.* FROM users AS u
JOIN user_programs AS up ON u.user_...