class Admin::InvitationController < Admin::ApplicationController
  include Admin::WorkshopConcerns

  # event invitations

  def update
    invitation = Invitation.find_by(token: params[:invitation][:id])
    invitation.update_attributes(attending: true, verified: true, verified_by: current_user)

    EventInvitationMailer.attending(invitation.event, invitation.member, invitation).deliver_now

    redirect_to :back, notice: "You have verified #{invitation.member.full_name}'s spot at the event!"
  end

  def verify
    invitation = Invitation.find_by(token: params[:invitation_id])
    invitation.update_attributes(verified: true, verified_by: current_user)

    EventInvitationMailer.attending(invitation.event, invitation.member, invitation).deliver_now

    redirect_to :back, notice: "You have verified #{invitation.member.full_name}'s spot at the event!"
  end

  def cancel
    invitation = Invitation.find_by(token: params[:invitation_id])
    invitation.update_attribute(:attending, false)

    redirect_to :back, notice: "You have cancelled #{invitation.member.full_name}'s attendance."
  end
end

class Admin::InvitationController < Admin::ApplicationController
  include Admin::WorkshopConcerns

  # event invitations

  def update
    invitation = Invitation.find_by(token: params[:invitation][:id])
    invitation.update(attending: true, verified: true, verified_by: current_user)

    EventInvitationMailer.attending(invitation.event, invitation.member, invitation).deliver_now

    redirect_to :back, notice: "You have verified #{invitation.member.full_name}'s spot at the event!"
  end

  def verify
    invitation = Invitation.find_by(token: params[:invitation_id])
    invitation.update(verified: true, verified_by_id: current_user.id)

    EventInvitationMailer.attending(invitation.event, invitation.member, invitation).deliver_now

    redirect_to :back, notice: "You have verified #{invitation.member.full_name}'s spot at the event!"
  end

  def cancel
    invitation = Invitation.find_by(token: params[:invitation_id])
    invitation.update(attending: false)

    redirect_to :back, notice: "You have cancelled #{invitation.member.full_name}'s attendance."
  end
end

Fix bullet unoptimised query error
Fix bullet unoptimised query error


```
  Bullet::Notification::UnoptimizedQueryError:
       user: despo
       POST /admin/events/omnis-1/invitation/e5jkug2T-bpuY0Yeqegb3A/verify
       AVOID eager loading detected
         Invitation => [:verified_by]
         Remove from your finder: :includes => [:verified_by]
      
```