Class: Deidentify::Generators::ConfigureForGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/deidentify/configure_for_generator.rb

Instance Method Summary collapse

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
# File 'lib/generators/deidentify/configure_for_generator.rb', line 12

def call
  template 'module_template.rb', File.join(module_path, "#{klass.underscore}_policy.rb")

  insert_into_file(
    model_path,
    "\n  include Deidentify::#{namespace_model}Policy",
    after: "#{klass} < ApplicationRecord"
  )
end