<commit_before>module Para
  module Acl
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)

      def install_migrations
        rake 'para_acl_engine:install:migrations'
        rake 'db:migrate'
      end

      def add_role_mixin_to_admin
        admin_user_class_file_path = File.join(
          'app', 'models', "#{ admin_user_class_name.underscore }.rb"
        )

        inject_into_file admin_user_class_file_path, after: "< ActiveRecord::Base" do
          "\n  has_admin_role"
        end<commit_msg>fixed call to admin user class name to fetch config. Handle rails 5 models<commit_after>module Para
  module Acl
    class InstallGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)

      def install_migrations
        rake 'para_acl_engine:install:migrations'
        rake 'db:migrate'
      end

      def add_role_mixin_to_admin
        admin_user_class_file_path = File.join(
          'app', 'models', "#{ Para.config.acl.admin_user_class.underscore }.rb"
        )

        inject_into_file admin_user_class_file_path, after: /< (ActiveRecord::Base|ApplicationRecord)/ do
          "\n  has_admin_role"
        end
{'fraction_non_alphanumeric': 0.08790322580645162, 'fraction_numerical': 0.0008064516129032258, 'mean_word_length': 2.9522292993630574, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5558342', 'n_tokens_mistral': 388, 'n_tokens_neox': 377, 'n_words': 78}