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



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

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

Instance Method Details

#copy_policy_filesObject

copy configuration



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

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