PDA

View Full Version : belongs_to + foreign_key


rubyonrails-talk
August 28th, 2006, 01:42 PM
Having these models:
class League < Tournament
has_many :league_positions, :order => :position, :dependent =>
end
class LeaguePosition < ActiveRecord::Base
belongs_to :league, :class_name => 'League', :foreign_key =>
'tournament_id'
acts_as_list :scope => :tournament_id
end
when I try to destroy a League (so its LeaguePositions too) I get these

More... (http://groups.google.com/group/rubyonrails-talk/msg/15c3818fbed989cb)