<commit_before>require_dependency 'permissions'

class YourAppsController < ApplicationController
  include Permissions

  before_filter :user_owns_profile_with_message, :only => [ :acceptance, :continue ]
  before_filter :set_title

  skip_before_filter :restrict_students
  
  def index
    redirect_to :action => :list
  end
  
  def find_profiles(profiles, o)
    o[:status] = o[:status].to_s if o[:status]

    profiles.find_all{ |p|
      if o[:class] != p.class
        false
      elsif o[:status]
        p.status == o[:status]
      else
        true
      end
    }
  end

  def list
    profiles = @viewer.profiles.find :all, :include => [ { :appln => { :form => :questionnaire } }, :project ],
       :select => "#{Profile.table_name}.id, #{Form.table_name}.event_group_id," +
                  "#{Profile.table_name}.status, #{Profile.table_name}.type," +<commit_msg>add cache sweeper to your apps<commit_after>require_dependency 'permissions'

class YourAppsController < ApplicationController
  include Permissions

  cache_sweeper :profiles_sweeper

  before_filter :user_owns_profile_with_message, :only => [ :acceptance, :continue ]
  before_filter :set_title

  skip_before_filter :restrict_students
  
  def index
    redirect_to :action => :list
  end
  
  def find_profiles(profiles, o)
    o[:status] = o[:status].to_s if o[:status]

    profiles.find_all{ |p|
      if o[:class] != p.class
        false
      elsif o[:status]
        p.status == o[:status]
      else
        true
      end
    }
  end

  def list
    profiles = @viewer.profiles.find :all, :include => [ { :appln => { :form => :questionnaire } }, :project ],
       :select => "#{Profile.table_name}.id, #{Form.table_name}.event_group_id," +
                  "#{Profile.table_name}.status, #{Profile.table_name}.type," +
{'fraction_non_alphanumeric': 0.12624035281146637, 'fraction_numerical': 0.0, 'mean_word_length': 3.1156462585034013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3210238', 'n_tokens_mistral': 600, 'n_tokens_neox': 588, 'n_words': 123}