<commit_before>class MoviesController < ApplicationController
  before_filter :require_user
  
  def index
    @movies = current_user.movies.find_all_by_wishlist(false)
  end
  
  def wishlist
  	@movies = current_user.movies.find_all_by_wishlist(true)
  end
  
  def show
    @movie = get_movie
  end
  
  def new
    @movie = Movie.new
  end
  
  def create
    @movie = Movie.new(params[:movie])
    @movie.user = current_user
    if @movie.save<commit_msg>Rewrote the index and wishlist fetching for more flexible querys, and added sorting by title<commit_after>class MoviesController < ApplicationController
  before_filter :require_user
  
  def index
    @movies = current_user.movies.find(:all, :conditions => ["movies.wishlist = ?", false], :order => "movies.title")
  end
  
  def wishlist
  	@movies = current_user.movies.find(:all, :conditions => ["movies.wishlist = ?", true], :order => "movies.title")
  end
  
  def show
    @movie = get_movie
  end
  
  def new
    @movie = Movie.new
  end
  
  def create
    @movie = Movie.new(params[:movie])
    @movie.user = current_user
    if @movie.save
{'fraction_non_alphanumeric': 0.0999099909990999, 'fraction_numerical': 0.0, 'mean_word_length': 3.3607843137254902, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2347274', 'n_tokens_mistral': 396, 'n_tokens_neox': 379, 'n_words': 89}