<commit_before>class ItemsController < ApplicationController

  hobo_model_controller

  auto_actions :all, :except => :index
  auto_actions_for :project, [:new, :create]
  show_action :ajax_item

  def create_for_project
    hobo_create do
      if valid?
        @item.state = "created"
        @item.save
        if request.xhr?
          render :partial => "ajax_box"
          return
        end

        redirect_to :back
      end
    end
  end

  def do_archive
    item = find_instance
    item.state = "archived"
    item.lane = item.project.lanes.last
    item.save
    redirect_to :back
  end

  def ajax_item
    if request.xhr?
      @item = find_instance
      render :partial => "ajax_item"
      return
    end
  end

  def edit
    @item = find_instance
  end

  def update
    @item = find_instance
    if @item.lane.id != params[:item][:lane_id]
      @item.lane = Lane.find(params[:item][:lane_id])
      @item.enqueue_item
      Lane.move_item(current_user, @item)
    end
<commit_msg>should finally fix S3111 - position was being updated every time item was edited<commit_after>class ItemsController < ApplicationController

  hobo_model_controller

  auto_actions :all, :except => :index
  auto_actions_for :project, [:new, :create]
  show_action :ajax_item

  def create_for_project
    hobo_create do
      if valid?
        @item.state = "created"
        @item.save
        if request.xhr?
          render :partial => "ajax_box"
          return
        end

        redirect_to :back
      end
    end
  end

  def do_archive
    item = find_instance
    item.state = "archived"
    item.lane = item.project.lanes.last
    item.save
    redirect_to :back
  end

  def ajax_item
    if request.xhr?
      @item = find_instance
      render :partial => "ajax_item"
      return
    end
  end

  def edit
    @item = find_instance
  end

  def update
    @item = find_instance
    if @item.lane.id.to_s != params[:item][:lane_id]
      @item.lane = Lane.find(params[:item][:lane_id])
      @item.enqueue_item
      Lane.move_item(current_user, @item)
    end

{'fraction_non_alphanumeric': 0.0862895493767977, 'fraction_numerical': 0.0019175455417066154, 'mean_word_length': 2.387987012987013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3812509', 'n_tokens_mistral': 698, 'n_tokens_neox': 673, 'n_words': 166}