Sha256: 81a4525ba97a2adca0668d324c7d3e3640cf39b7a21c4cae1ef6f4d3a41858c4
Contents?: true
Size: 791 Bytes
Versions: 8
Compression:
Stored size: 791 Bytes
Contents
class Club < ActiveRecord::Base has_one :membership has_many :memberships, :inverse_of => false has_many :members, :through => :memberships has_one :sponsor has_one :sponsored_member, :through => :sponsor, :source => :sponsorable, :source_type => "Member" belongs_to :category has_many :favourites, -> { where(memberships: { favourite: true }) }, through: :memberships, source: :member scope :general, -> { left_joins(:category).where(categories: { name: "General" }) } private def private_method "I'm sorry sir, this is a *private* club, not a *pirate* club" end end class SuperClub < ActiveRecord::Base self.table_name = "clubs" has_many :memberships, class_name: 'SuperMembership', foreign_key: 'club_id' has_many :members, through: :memberships end
Version data entries
8 entries across 8 versions & 1 rubygems