aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/club.rb
blob: 816c5e69378047e1a869690106d650be4ec0f2cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Club < ActiveRecord::Base
  has_one :membership
  has_many :memberships, :inverse_of => false
  has_many :members, :through => :memberships
  has_many :current_memberships
  has_one :sponsor
  has_one :sponsored_member, :through => :sponsor, :source => :sponsorable, :source_type => "Member"
  belongs_to :category

  private

  def private_method
    "I'm sorry sir, this is a *private* club, not a *pirate* club"
  end
end