Sha256: 4df0db6e76964e06e0358debcffefd5c4ba92444ef50045bb236cee5f08946c5

Contents?: true

Size: 559 Bytes

Versions: 9

Compression:

Stored size: 559 Bytes

Contents

require 'rails/generators'

module Ckeditor
  module Generators
    class PunditPolicyGenerator < Rails::Generators::Base
      desc 'Generates policy files for Pundit'

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

      # copy configuration
      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
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
glebtv-ckeditor-4.11.1 lib/generators/ckeditor/pundit_policy_generator.rb
ckeditor-4.3.0 lib/generators/ckeditor/pundit_policy_generator.rb
glebtv-ckeditor-4.7.3.1 lib/generators/ckeditor/pundit_policy_generator.rb
glebtv-ckeditor-4.7.3 lib/generators/ckeditor/pundit_policy_generator.rb
ckeditor-4.2.4 lib/generators/ckeditor/pundit_policy_generator.rb
ckeditor-4.2.3 lib/generators/ckeditor/pundit_policy_generator.rb
ckeditor-4.2.2 lib/generators/ckeditor/pundit_policy_generator.rb
ckeditor-4.2.1 lib/generators/ckeditor/pundit_policy_generator.rb
ckeditor-4.2.0 lib/generators/ckeditor/pundit_policy_generator.rb