2008-03-21 18:09:03 +00:00
|
|
|
class Sponsor < ActiveRecord::Base
|
|
|
|
belongs_to :sponsor_club, :class_name => "Club", :foreign_key => "club_id"
|
|
|
|
belongs_to :sponsorable, :polymorphic => true
|
2011-01-01 18:18:54 +00:00
|
|
|
belongs_to :thing, :polymorphic => true, :foreign_type => :sponsorable_type, :foreign_key => :sponsorable_id
|
2011-01-07 01:06:29 +00:00
|
|
|
belongs_to :sponsorable_with_conditions, :polymorphic => true,
|
|
|
|
:foreign_type => 'sponsorable_type', :foreign_key => 'sponsorable_id', :conditions => {:name => 'Ernie'}
|
2011-01-01 18:18:54 +00:00
|
|
|
end
|