<commit_before>class FfcrmApi::V1::EntitiesController < FfcrmApi::ApplicationController
  before_filter :require_login

  respond_to :json
  rescue_from ActiveRecord::RecordNotFound, :with => :not_found

  # TODO paging and custom ordering support required
  def index
    entities = klass.order(:created_at)
    entities = entities.where(:id => params[:ids]) unless params[:ids].nil?
    render :json => entities, :each_serializer => serializer
  end

  def show
    render :json => entity, :serializer => serializer
  end

  def update
    entity.update_attributes( params[entity_name], :without_protection => true ) # TODO whitelisting
    render :json => entity, :serializer => serializer
  end

  def destroy
    entity.destroy
    render :json => {}
  end
<commit_msg>change to descending order<commit_after>class FfcrmApi::V1::EntitiesController < FfcrmApi::ApplicationController
  before_filter :require_login

  respond_to :json
  rescue_from ActiveRecord::RecordNotFound, :with => :not_found

  # TODO paging and custom ordering support required
  def index
    entities = klass.order('created_at DESC')
    entities = entities.where(:id => params[:ids]) unless params[:ids].nil?
    render :json => entities, :each_serializer => serializer
  end

  def show
    render :json => entity, :serializer => serializer
  end

  def update
    entity.update_attributes( params[entity_name], :without_protection => true ) # TODO whitelisting
    render :json => entity, :serializer => serializer
  end

  def destroy
    entity.destroy
    render :json => {}
  end

{'fraction_non_alphanumeric': 0.09891512444160817, 'fraction_numerical': 0.0012763241863433313, 'mean_word_length': 4.351535836177474, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '4435390', 'n_tokens_mistral': 451, 'n_tokens_neox': 447, 'n_words': 126}