Guest User

Untitled

a guest
Feb 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #
  2. # Find events for which the given member has accepted the corresponding notification.
  3. #
  4. named_scope :accepted_by_user, lambda { |user_id| { :joins => "inner join respondables on respondables.event_id = events.id", :conditions => ["respondables.user_id = ? and respondables.status = 'accepted'", user_id] } }
  5.  
  6. #
  7. # Find events for which the given member has not responded to the corresponding notification.
  8. #
  9. named_scope :unresponded_by_user, lambda { |user_id| { :joins => "inner join respondables on respondables.event_id = events.id", :conditions => ["respondables.user_id = ? and respondables.status = 'sent' or respondables.status = 'viewed'", user_id] } }
Add Comment
Please, Sign In to add comment