<commit_before>class ImagesController < ApplicationController
  respond_to :html, :json

  def show
    album = Album.find_by_slug(params[:album_id])
    image = album.images.find(params[:id])
    page_number = image.album_page_num
    authorize!(:show, image)

    redirect_to paginated_album_path(album, page_number,
      anchor: "/images/#{params[:id]}"
    )
  end

  def create
    @album = Album.find_by_slug!(params[:album_id])
    @image = @album.images.new(image_params)
    @image.uploader = current_user
    authorize!(:create, @image)

    @image.save<commit_msg>Minor code style tweak<commit_after>class ImagesController < ApplicationController
  respond_to :html, :json

  def show
    album = Album.find_by_slug(params[:album_id])
    image = album.images.find(params[:id])
    authorize!(:show, image)

    redirect_to paginated_album_path(album, image.album_page_num,
      anchor: "/images/#{params[:id]}"
    )
  end

  def create
    @album = Album.find_by_slug!(params[:album_id])
    @image = @album.images.new(image_params)
    @image.uploader = current_user
    authorize!(:create, @image)

    @image.save
{'fraction_non_alphanumeric': 0.1246684350132626, 'fraction_numerical': 0.0, 'mean_word_length': 4.076233183856503, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '803901', 'n_tokens_mistral': 379, 'n_tokens_neox': 373, 'n_words': 66}