Skip to content
Extraits de code Groupes Projets
  • tamatsyk's avatar
    960e6517
    internationalize controller rescue_from text · 960e6517
    tamatsyk a rédigé
    Fix typos
    
    change forbitten to forbidden
    
    fix styling issue and copypaste
    
    improve code style for aspec_memberships_controller.rb with rubocop
    
    fix styling issues
    
    aligned elements of hash literals
    
    fix typo
    
    fix locale name and styling of its usage
    
    fix failing tests
    
    closes #6554
    960e6517
    Historique
    internationalize controller rescue_from text
    tamatsyk a rédigé
    Fix typos
    
    change forbitten to forbidden
    
    fix styling issue and copypaste
    
    improve code style for aspec_memberships_controller.rb with rubocop
    
    fix styling issues
    
    aligned elements of hash literals
    
    fix typo
    
    fix locale name and styling of its usage
    
    fix failing tests
    
    closes #6554
invitation_codes_controller.rb 469 o
class InvitationCodesController < ApplicationController
  before_action :ensure_valid_invite_code

  rescue_from ActiveRecord::RecordNotFound do
    redirect_to root_url, :notice => I18n.t('invitation_codes.not_valid')
  end

  def show 
    sign_out(current_user) if user_signed_in?
    redirect_to new_user_registration_path(:invite => {:token => params[:id]})
  end

  private

  def ensure_valid_invite_code
    InvitationCode.find_by_token!(params[:id])
  end
end