<commit_before>#   Copyright (c) 2010, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

class AspectsController < ApplicationController
  before_filter :authenticate_user!

  respond_to :html
  respond_to :json, :only => [:show, :create]
  respond_to :js

  def index
    if params[:a_ids]
      @aspects = current_user.aspects.where(:id => params[:a_ids]).includes(:contacts => {:person => :profile})
      @selected_contacts = @aspects.inject([]){|arr, aspect| arr.concat(aspect.contacts)}
      @selected_contacts.uniq!
    else
      @aspects = current_user.aspects.includes(:contacts => {:person => :profile})
      @selected_contacts = current_user.contacts
    end

    # redirect to signup
    if (current_user.getting_started == true || @aspects.blank?) && !request.format.mobile?
      redirect_to getting_started_path
    else
      if params[:sort_order].blank? and session[:sort_order].blank?<commit_msg>Take out n-query on home page<commit_after>#   Copyright (c) 2010, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

class AspectsController < ApplicationController
  before_filter :authenticate_user!

  respond_to :html
  respond_to :json, :only => [:show, :create]
  respond_to :js

  def index
    if params[:a_ids]
      @aspects = current_user.aspects.where(:id => params[:a_ids]).includes(:contacts => {:person => :profile})
      @selected_contacts = @aspects.inject([]){|arr, aspect| arr.concat(aspect.contacts)}
      @selected_contacts.uniq!
    else
      @aspects = current_user.aspects.includes(:contacts => {:person => :profile})
      @selected_contacts = current_user.contacts.includes(:person => :profile)
    end

    # redirect to signup
    if (current_user.getting_started == true || @aspects.blank?) && !request.format.mobile?
      redirect_to getting_started_path
    else
      if params[:sort_order].blank? and session[:sort_order].blank?
{'fraction_non_alphanumeric': 0.12035225048923678, 'fraction_numerical': 0.004892367906066536, 'mean_word_length': 4.036945812807882, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '393949', 'n_tokens_mistral': 664, 'n_tokens_neox': 635, 'n_words': 155}