app/controllers/application_controller.rb
def redirect_decisions
    @attendee = @event&.attendees&.find_by(user: current_user)
    @invitation = @event&.invitations&.find_by(user: current_user, event: @event)
    # Existe el evento y ya tienes equipo
    return redirect_to event_review_path(@event) if @event && @attendee&.team
    # Existe el evento y ya hiciste checkin
    return redirect_to event_select_path(@event) if @event && @attendee
    # Existe el evento y ya aceptace la invitation
    return redirect_to event_checkin_path(@event) if @event && @invitation&.accepted?
    # Existe el evento y la invitation esta pendiente
    return redirect_to invitations_path if @event && @invitation&.pending?
    redirect_to edit_user_path
  end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def redirect_decisions
    @attendee = @event&.attendees&.find_by(user: current_user)
    @invitation = @event&.invitations&.find_by(user: current_user, event: @event)
    return redirect_to event_review_path(@event) if @event && @attendee&.team
    return redirect_to event_select_path(@event) if @event && @attendee
    return redirect_to event_checkin_path(@event) if @event && @invitation&.accepted?
    return redirect_to invitations_path if @event && @invitation&.pending?
    redirect_to edit_user_path
  end
def redirect_decisions @attendee = @event &. attendees &. find_by ( user : current_user ) @invitation = @event &. invitations &. find_by ( user : current_user , event : @event ) return redirect_to event_review_path ( @event ) if @event && @attendee &. team return redirect_to event_select_path ( @event ) if @event && @attendee return redirect_to event_checkin_path ( @event ) if @event && @invitation &. accepted? return redirect_to invitations_path if @event && @invitation &. pending? redirect_to edit_user_path end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .
# Existe el evento y ya tienes equipo # Existe el evento y ya hiciste checkin # Existe el evento y ya aceptace la invitation # Existe el evento y la invitation esta pendiente