<commit_before>class RentalsController < ApplicationController
  @per_page = 10

  before_action :set_rental, only: [:show, :edit, :update, :destroy, :transform]
  before_action :set_item_types, only: [:index, :new, :create, :edit, :update, :processing]
  before_action :set_users, only: [:index, :new, :processing, :transform]
  before_action :set_incidental_types, only: [:new]

  # GET /rentals
  def index
    @q = Rental.all.search(params[:q])
    @rentals = @q.result(distinct: true).paginate(page: params[:page], per_page: @per_page)
    @users = User.all

    gon.reservations = Rental.to_json_reservations
  end

  # GET /rentals/1
  def show
  end

  # GET /rentals/new
  def new
    @rental = Rental.new
    @start_date = params['start_date'].try(:to_date) || Time.zone.today
		@admin_status = @current_user.has_group? Group.where(name: "admin")
  end

  # GET /rentals/processing
  def processing
    @q = Rental.all.search(params[:q])
    @rentals = @q.result(distinct: true).where('start_time >= ? AND start_time <= ?', Time.current.beginning_of_day,
                                               Time.current.end_of_day).paginate(page: params[:page], per_page: @per_page)
  end

  # GET /rentals/1/transform
  def transform
    if @rental.rental_status == 'reserved'
      render :check_out, locals: { rental: @rental }
    elsif @rental.rental_status == 'checked_out'
      render :check_in, locals: { rental: @rental }
    else
      flash[:danger] = 'Error redirecting to processing form'
      render :index
    end
  end
<commit_msg>String interpolation fix<commit_after>class RentalsController < ApplicationController
  @per_page = 10

  before_action :set_rental, only: [:show, :edit, :update, :destroy, :transform]
  before_action :set_item_types, only: [:index, :new, :create, :edit, :update, :processing]
  before_action :set_users, only: [:index, :new, :processing, :transform]
  before_action :set_incidental_types, only: [:new]

  # GET /rentals
  def index
    @q = Rental.all.search(params[:q])
    @rentals = @q.result(distinct: true).paginate(page: params[:page], per_page: @per_page)
    @users = User.all

    gon.reservations = Rental.to_json_reservations
  end

  # GET /rentals/1
  def show
  end

  # GET /rentals/new
  def new
    @rental = Rental.new
    @start_date = params['start_date'].try(:to_date) || Time.zone.today
    @admin_status = @current_user.has_group? Group.where(name: 'admin')
  end

  # GET /rentals/processing
  def processing
    @q = Rental.all.search(params[:q])
    @rentals = @q.result(distinct: true).where('start_time >= ? AND start_time <= ?', Time.current.beginning_of_day,
                                               Time.current.end_of_day).paginate(page: params[:page], per_page: @per_page)
  end

  # GET /rentals/1/transform
  def transform
    if @rental.rental_status == 'reserved'
      render :check_out, locals: { rental: @rental }
    elsif @rental.rental_status == 'checked_out'
      render :check_in, locals: { rental: @rental }
    else
      flash[:danger] = 'Error redirecting to processing form'
      render :index
    end
  end

{'fraction_non_alphanumeric': 0.13136815123357898, 'fraction_numerical': 0.00256328099967959, 'mean_word_length': 3.4663805436337625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5269926', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1052, 'n_words': 236}