Class: SocialNetworking::Nudge

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/social_networking/nudge.rb

Overview

A form of contact between two Participants.

Class Method Summary collapse

Class Method Details

.search(recipient_id = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'app/models/social_networking/nudge.rb', line 17

def self.search(recipient_id = nil)
  if recipient_id
    select(:initiator_id)
      .where(recipient_id: recipient_id)
      .where("created_at > ?", 1.day.ago)
      .group(:initiator_id)
  else
    all
  end
end