2008-03-21 14:09:03 -04:00
|
|
|
class Club < ActiveRecord::Base
|
2011-01-26 18:00:13 -05:00
|
|
|
has_one :membership
|
2013-06-07 23:59:27 -04:00
|
|
|
has_many :memberships, :inverse_of => false
|
2008-03-21 14:09:03 -04:00
|
|
|
has_many :members, :through => :memberships
|
2008-03-21 22:20:37 -04:00
|
|
|
has_one :sponsor
|
|
|
|
has_one :sponsored_member, :through => :sponsor, :source => :sponsorable, :source_type => "Member"
|
2010-10-14 08:44:32 -04:00
|
|
|
belongs_to :category
|
2008-10-13 13:01:37 -04:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def private_method
|
|
|
|
"I'm sorry sir, this is a *private* club, not a *pirate* club"
|
|
|
|
end
|
2010-10-14 08:44:32 -04:00
|
|
|
end
|