Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Find events for which the given member has accepted the corresponding notification.
- #
- 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] } }
- #
- # Find events for which the given member has not responded to the corresponding notification.
- #
- 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