<commit_before>class ReservationsController < ApplicationController
  before_filter :require_login, :only => [:index, :show]
  before_filter :require_checkout_person, :only => [:check_out, :check_in]
  
  def index
    if current_user.can_checkout?
      if params[:show_returned]
        @reservations = Reservation.find(:all, :order => 'start_date ASC')
      else
        @reservations = Reservation.find(:all, :order => 'start_date ASC')
        @reservations = @reservations.select{|r| r.checked_in == nil}
      end
    else
      @reservations = current_user.reservations.sort_by(&:start_date).reverse
    end
  end<commit_msg>fixed the bug, forgot sql wants blah is null, not blah = null<commit_after>class ReservationsController < ApplicationController
  before_filter :require_login, :only => [:index, :show]
  before_filter :require_checkout_person, :only => [:check_out, :check_in]
  
  def index
    if current_user.can_checkout?
      if params[:show_returned]
        @reservations = Reservation.find(:all, :order => 'start_date ASC')
      else
        @reservations = Reservation.find(:all, :conditions => ["checked_in is NULL"],  :order => 'start_date ASC')
      end
    else
      @reservations = current_user.reservations.sort_by(&:start_date).reverse
    end
  end
{'fraction_non_alphanumeric': 0.11353032659409021, 'fraction_numerical': 0.0, 'mean_word_length': 3.969111969111969, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '401085', 'n_tokens_mistral': 411, 'n_tokens_neox': 403, 'n_words': 90}