<commit_before>class ApplicationController < ActionController::Base
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :null_session
  after_action :unset_current_device

  def unset_current_device
    Device.send(:current=, nil)
  end

  def current_device
    return @current_device if @current_device
    current_user || autheticate_user!
    @current_device = current_user.device || no_device<commit_msg>Fix NoMethodError in ApplicationController<commit_after>class ApplicationController < ActionController::Base
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :null_session
  after_action :unset_current_device

  def unset_current_device
    Device.send(:current=, nil)
  end

  def current_device
    return @current_device if @current_device
    authenticate_user! unless current_user
    @current_device = current_user.device || no_device
{'fraction_non_alphanumeric': 0.06086956521739131, 'fraction_numerical': 0.0, 'mean_word_length': 5.395833333333333, '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': '7046469', 'n_tokens_mistral': 267, 'n_tokens_neox': 261, 'n_words': 69}