Sha256: 33379076a1063b5b691023690b7e68f981bada729b5f7636d7e716bf154d857b

Contents?: true

Size: 329 Bytes

Versions: 4

Compression:

Stored size: 329 Bytes

Contents

module Pundit
  module Generators
    class PolicyGenerator < ::Rails::Generators::NamedBase
      source_root File.expand_path('templates', __dir__)

      def create_policy
        template 'policy.rb', File.join('app/policies', class_path, "#{file_name}_policy.rb")
      end

      hook_for :test_framework
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pundit-2.1.0 lib/generators/pundit/policy/policy_generator.rb
pundit-2.0.1 lib/generators/pundit/policy/policy_generator.rb
pundit-2.0.0 lib/generators/pundit/policy/policy_generator.rb
pundit-2.0.0.beta1 lib/generators/pundit/policy/policy_generator.rb