VRFS-1891 cancel RSVP flow fix

This commit is contained in:
Brian Smith 2014-08-09 23:22:17 -04:00
parent fd9893ca42
commit cc26969f8a
1 changed files with 2 additions and 1 deletions

View File

@ -100,9 +100,10 @@ module JamRuby
# verify user has not already submitted RSVP request for this slot
rsvp = RsvpRequest.joins(:rsvp_requests_rsvp_slots)
.where(:user_id => user.id)
.where(:canceled => false)
.where(rsvp_requests_rsvp_slots: {rsvp_slot_id: id})
if !rsvp.blank? && !rsvp.canceled
if !rsvp.blank?
raise StateError, "You have already submitted an RSVP request for this slot."
end