<commit_before>module MobileFormatOverride
  extend ActiveSupport::Concern

  included do
    before_action :prepare_mobile, :override_format_if_mobile

    helper_method :mobile?, :mobile_app?
  end

  def prepare_mobile
    return unless params[:mobile]
    session[:mobile] = params[:mobile]
  end

  def override_format_if_mobile
    return unless mobile?
    request.variant = :mobile
  end

  def mobile?
    (browser.device.mobile? && session[:mobile] == '1') || mobile_app?
  end

  def mobile_app?
    browser.ua.start_with? 'turbolinks-view'
  end
end<commit_msg>Enable mobile for everyone (#129)<commit_after>module MobileFormatOverride
  extend ActiveSupport::Concern

  included do
    before_action :set_mobile_variant

    helper_method :mobile?, :mobile_app?
  end

  def set_mobile_variant
    return unless mobile?
    request.variant = :mobile
  end

  def mobile?
    browser.device.mobile? || mobile_app?
  end

  def mobile_app?
    browser.ua.start_with? 'turbolinks-view'
  end
end
{'fraction_non_alphanumeric': 0.08358208955223881, 'fraction_numerical': 0.003980099502487562, 'mean_word_length': 3.98019801980198, 'pattern_counts': {'":': 0, '<': 3, '<?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': '523593', 'n_tokens_mistral': 324, 'n_tokens_neox': 306, 'n_words': 76}