search for: ref_up

Displaying 1 result from an estimated 1 matches for "ref_up".

Did you mean: ref_bh
2006 Jul 02
1
prevent duplicate inserts with has_many :through ??
Does anyone have an efficient/elegant way to prevent duplicate inserts when using a has_many :through relationship. So I have something like this: class User < ActiveRecord::Base has_many :favorite_teams has_many :teams, :through => :favorite_teams end class FavoriteTeams < ActiveRecord::Base belongs_to :user belongs_to :team end class Teams < ActiveRecord::Base has_many