<commit_before>class TourController < ApplicationController

  before_filter :authenticate_user!
  layout "tour"

  before_filter :can_access_webapp

  def almost_done
    @step_in_signup_process = :account
  end

  def create_your_first_factlink
    @step_in_signup_process = :create_factlink
    render layout: "frontend"
  end

  def choose_channels
    @step_in_signup_process = :almost_done
    @user = current_user
    set_seen_the_tour current_user
    render inline:'', layout: "channels"
  end

  private
  def set_seen_the_tour user
    user.seen_the_tour = true
    user.save
  end

  def can_access_webapp
    authorize! :access, Ability::FactlinkWebapp
  end
end<commit_msg>Capture error when not succesfully saving user<commit_after>class TourController < ApplicationController

  before_filter :authenticate_user!
  layout "tour"

  before_filter :can_access_webapp

  def almost_done
    @step_in_signup_process = :account
  end

  def create_your_first_factlink
    @step_in_signup_process = :create_factlink
    render layout: "frontend"
  end

  def choose_channels
    @step_in_signup_process = :almost_done
    @user = current_user
    set_seen_the_tour current_user
    render inline:'', layout: "channels"
  end

  private
  def set_seen_the_tour user
    user.seen_the_tour = true
    user.save!
  rescue
    Raven.capture_exception(exception)
  end

  def can_access_webapp
    authorize! :access, Ability::FactlinkWebapp
  end
end
{'fraction_non_alphanumeric': 0.054945054945054944, 'fraction_numerical': 0.0, 'mean_word_length': 4.203571428571428, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4612080', 'n_tokens_mistral': 498, 'n_tokens_neox': 472, 'n_words': 107}