Fix bug in User#registered_to_event?

Fix exception being thrown in `User#registered_to_event?` when the user
is not registered in the corresponding event conference.
This commit is contained in:
Alberto Miedes Garcés 2017-03-15 23:35:29 +01:00
parent c2866a1810
commit e5aa6ab868

View file

@ -87,7 +87,7 @@ class User < ActiveRecord::Base
# ====Returns
# * +true+ or +false+
def registered_to_event? event
event.registrations.pluck(:id).include? self.registrations.find_by(conference_id: event.program.conference.id).id
event.registrations.include? registrations.find_by(conference: event.program.conference)
end
def subscribed? conference