<commit_before>class JobsController < ApplicationController

  def index
    if [:show_fulltime, :show_parttime, :show_contract].any?{|s| params[s].blank? }
      params[:show_fulltime] = 'true'
      params[:show_parttime] = 'true'
      params[:show_contract] = 'true'
      params[:show_remote] = 'false'
    end
    roles = []
    roles.push(Job::FULLTIME) if params[:show_fulltime] == 'true'
    roles.push(Job::PARTTIME) if params[:show_parttime] == 'true'
    roles.push(Job::CONTRACT) if params[:show_contract] == 'true'
    @jobs = Job.active.order(created_at: :desc)
    @jobs = @jobs.where('jobs.role_type in (?)', roles)
    @jobs = @jobs.where(location: 'Remote') if params[:show_remote] == 'true'
    @jobs = @jobs.where('jobs.location ilike :q or jobs.title ilike :q or jobs.company ilike :q', q: "%#{params[:q]}%") unless params[:q].blank?

    if params[:posted]
      @jobs = @jobs.where.not(id: params[:posted])
      @featured = Job.find(params[:posted])
    end
  end

  def new
    @job = Job.new
  end

  def show
    @job = Job.find(params[:id])

    JobView.create!(
      job_id: @job.id,
      user_id: current_user.try(:id),<commit_msg>No rss for jobs, sorry<commit_after>class JobsController < ApplicationController
  def index
    if [:show_fulltime, :show_parttime, :show_contract].any?{|s| params[s].blank? }
      params[:show_fulltime] = 'true'
      params[:show_parttime] = 'true'
      params[:show_contract] = 'true'
      params[:show_remote] = 'false'
    end
    roles = []
    roles.push(Job::FULLTIME) if params[:show_fulltime] == 'true'
    roles.push(Job::PARTTIME) if params[:show_parttime] == 'true'
    roles.push(Job::CONTRACT) if params[:show_contract] == 'true'
    @jobs = Job.active.order(created_at: :desc)
    @jobs = @jobs.where('jobs.role_type in (?)', roles)
    @jobs = @jobs.where(location: 'Remote') if params[:show_remote] == 'true'
    @jobs = @jobs.where('jobs.location ilike :q or jobs.title ilike :q or jobs.company ilike :q', q: "%#{params[:q]}%") unless params[:q].blank?

    if params[:posted]
      @jobs = @jobs.where.not(id: params[:posted])
      @featured = Job.find(params[:posted])
    end

    respond_to :html
  end

  def new
    @job = Job.new
  end

  def show
    @job = Job.find(params[:id])

    JobView.create!(
      job_id: @job.id,
      user_id: current_user.try(:id),
{'fraction_non_alphanumeric': 0.16878710771840544, 'fraction_numerical': 0.0, 'mean_word_length': 3.6164383561643834, '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': '6324875', 'n_tokens_mistral': 862, 'n_tokens_neox': 829, 'n_words': 173}