<commit_before>class Admin::BaseController < ApplicationController
  inherit_resources
  before_filter do
    authorize! :access, :admin
  end

  def update
    update! do |format|
      if resource.errors.empty?
        format.json { respond_with_bip(resource) }
      else
        format.html { render action: "edit" }
        format.json { respond_with_bip(resource) }
      end
    end
  end
end
<commit_msg>Use admin policy class on admin<commit_after>module Admin
  def self.policy_class
    AdminPolicy
  end

  class BaseController < ApplicationController
    inherit_resources

    before_filter do
      authorize Admin, :access?
    end

    def update
      update! do |format|
        if resource.errors.empty?
          format.json { respond_with_bip(resource) }
        else
          format.html { render action: 'edit' }
          format.json { respond_with_bip(resource) }
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06659505907626208, 'fraction_numerical': 0.0, 'mean_word_length': 2.4518518518518517, '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': '7307009', 'n_tokens_mistral': 271, 'n_tokens_neox': 266, 'n_words': 72}