Class: Ckeditor::Generators::PunditPolicyGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Ckeditor::Generators::PunditPolicyGenerator
- Defined in:
- lib/generators/ckeditor/pundit_policy_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#copy_policy_files ⇒ Object
copy configuration.
Class Method Details
.source_root ⇒ Object
9 10 11 |
# File 'lib/generators/ckeditor/pundit_policy_generator.rb', line 9 def self.source_root @source_root ||= File.(File.join(File.dirname(__FILE__), 'templates')) end |
Instance Method Details
#copy_policy_files ⇒ Object
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 |