<commit_before>class VersionsController < ApplicationController
# TODO: Requires authorization
  # def revert
  #   @version = Version.find(params[:id])
  #   if @version.reify
  #     @version.reify.save!
  #   else
  #     @version.item.destroy
  #   end
  #   link_name = params[:redo] == "true" ? "undo" : "redo"
  #   link = view_context.link_to(link_name, revert_version_path(@version.next, :redo => !params[:redo]), :method => :post)
  #   redirect_to :back, :notice => "Undid #{@version.event}. #{link}"
  # end
  
  private
  
  # def undo_link object
  #   view_context.link_to("undo", revert_version_path(object.versions.scoped.last), :method => :post)
  # end
end<commit_msg>paper_trail conflicts with optimistic locking; giving up for now<commit_after>class VersionsController < ApplicationController
# TODO: Requires authorization
  # def revert
  #   @version = Version.find(params[:id])
  #   if @version.reify
# FIXME: this is incompatible with optimistic locking.
# See https://github.com/airblade/paper_trail/issues/163
  #     @version.reify.save!
  #   else
  #     @version.item.destroy
  #   end
  #   link_name = params[:redo] == "true" ? "undo" : "redo"
  #   link = view_context.link_to(link_name, revert_version_path(@version.next, :redo => !params[:redo]), :method => :post)
  #   redirect_to :back, :notice => "Undid #{@version.event}. #{link}"
  # end
  
  private
  
  # def undo_link object
  #   view_context.link_to("undo", revert_version_path(object.versions.scoped.last), :method => :post)
  # end
end
{'fraction_non_alphanumeric': 0.14508783344176968, 'fraction_numerical': 0.001951854261548471, 'mean_word_length': 3.867088607594937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 1, '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': '3000801', 'n_tokens_mistral': 540, 'n_tokens_neox': 523, 'n_words': 106}