mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
d6b03a3767
of using +inverse_of: false+ option. Changing the documentation and adding a CHANGELOG entry for the automatic inverse detection feature.
15 lines
431 B
Ruby
15 lines
431 B
Ruby
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
|