Sha256: c1fbd667fb782daf84f9c340744e85a7097ef935126a86c9968b6658bffb77dd
Contents?: true
Size: 499 Bytes
Versions: 30
Compression:
Stored size: 499 Bytes
Contents
class Membership < ActiveRecord::Base belongs_to :group belongs_to :reader named_scope :for, lambda { |reader| { :conditions => ["memberships.reader_id = ?", reader.id] } } named_scope :of, lambda { |group| { :conditions => ["memberships.group_id = ?", group.id] } } named_scope :by_reader_name, lambda { { :joins => "INNER JOIN readers on memberships.reader_id = readers.id", :group => "readers.id", :order => "readers.name ASC" } } end
Version data entries
30 entries across 30 versions & 1 rubygems