Sha256: 584f9d7559d43d7c29f0c10e61cc8a580deb5fc86d0509875cc3df96d9579def
Contents?: true
Size: 781 Bytes
Versions: 10
Compression:
Stored size: 781 Bytes
Contents
module MuckInvites module Models #:nodoc: module MuckInvite #:nodoc: extend ActiveSupport::Concern included do belongs_to :invitee belongs_to :inviter, :polymorphic => true # User and inviter might be the same. For example, if a user invites their friends then user == inviter. # However if inviter is something else for example an Event then having a user field let's us quickly # discover who created the invite. (Used by who_invited?) belongs_to :user scope :by_newest, :order => "created_at DESC" scope :by_oldest, :order => "created_at ASC" scope :newer_than, lambda { |*args| where("invites.created_at > ?", args.first || 1.week.ago) } end end end end
Version data entries
10 entries across 10 versions & 1 rubygems