<commit_before>#
# == ApplicationController
#
class ApplicationController < ActionController::Base
  include ApplicationHelper
  include SocialHelper
  include HtmlHelper
  include UserHelper

  protect_from_forgery with: :exception
  analytical modules: [:google]

  before_action :set_language
  before_action :set_setting
  before_action :set_menu_elements
  before_action :set_background
  before_action :set_host_name
  before_action :set_newsletter_user

  decorates_assigned :setting, :category

  private

  def set_language
    @language = I18n.locale
    gon.push(language: @language)
  end
<commit_msg>Fix bug with Background when Category was nil<commit_after>#
# == ApplicationController
#
class ApplicationController < ActionController::Base
  include ApplicationHelper
  include SocialHelper
  include HtmlHelper
  include UserHelper

  protect_from_forgery with: :exception
  analytical modules: [:google]

  before_action :set_language
  before_action :set_setting
  before_action :set_menu_elements
  before_action :set_background, unless: proc { @cateogry.nil? }
  before_action :set_host_name
  before_action :set_newsletter_user

  decorates_assigned :setting, :category

  private

  def set_language
    @language = I18n.locale
    gon.push(language: @language)
  end

{'fraction_non_alphanumeric': 0.05809450038729667, 'fraction_numerical': 0.003098373353989156, 'mean_word_length': 5.396039603960396, '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': '119566', 'n_tokens_mistral': 386, 'n_tokens_neox': 371, 'n_words': 94}