<commit_before>require 'rails/generators/active_record'
require 'active_support/core_ext'

module ActiveRecord
  module Generators
    class RolifyGenerator < ActiveRecord::Generators::Base
      source_root File.expand_path("../templates", __FILE__)
      
      argument :user_cname, :type => :string, :default => "User", :banner => "User"
      
      def generate_model
        invoke "active_record:model", [ name ], :migration => false
      end
      
      def inject_role_class
        inject_into_class(model_path, class_name, model_content)
      end<commit_msg>Update rolify_generator.rb<commit_after>require 'rails/generators/active_record'
require 'active_support/core_ext'

module ActiveRecord
  module Generators
    class RolifyGenerator < ActiveRecord::Generators::Base
      source_root File.expand_path("../templates", __FILE__)
      
      argument :user_cname, :type => :string, :default => "User", :banner => "User"
      
      def generate_model
        invoke "active_record:model", [ name ], :migration => false
      end
      
      def inject_role_class
        if args[1]=="engine"
          if args[2]=="devise"
            require 'devise'
            require "#{ENGINE_ROOT}/config/initializers/devise.rb"
            require "#{ENGINE_ROOT}/app/models/#{user_cname.downcase}.rb"
          else
            require "#{ENGINE_ROOT}/app/models/#{user_cname.downcase}.rb"
          end
        end
        inject_into_class(model_path, class_name, model_content)
      end
{'fraction_non_alphanumeric': 0.1077127659574468, 'fraction_numerical': 0.0013297872340425532, 'mean_word_length': 2.9192708333333335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '5100383', 'n_tokens_mistral': 448, 'n_tokens_neox': 442, 'n_words': 87}