Class: Ckeditor::Generators::PunditPolicyGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/generators/ckeditor/pundit_policy_generator.rb', line 10

def self.source_root
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
end

Instance Method Details

#copy_policy_filesObject

copy configuration



15
16
17
18
19
# File 'lib/generators/ckeditor/pundit_policy_generator.rb', line 15

def copy_policy_files
  [:picture, :attachment_file].each do |model_name|
    template "pundit_policy/#{model_name}_policy.rb", "app/policies/ckeditor/#{model_name}_policy.rb"
  end
end