test I removed accidentally while rebasing restored

This commit is contained in:
Ana 2016-04-27 00:41:40 +02:00
parent 22916971c7
commit a30893fae3

View file

@ -56,6 +56,14 @@ class User < ActiveRecord::Base
validate :biography_limit
##
# Checkes if the user attended the event
# This is used for events that require registration
# The user must have registered to attend the event
# Gets an event
# === Returns
# * +true+ if the user attended the event
# * +false+ if the user did not attend the event
def attended_event? event
event_registration = event.events_registrations.find_by(registration: self.registrations)