Sha256: c2dff9a6e2929c04983db71eb6e50414e9a22c42f862fd24fdcf199bbe2b50de

Contents?: true

Size: 360 Bytes

Versions: 8

Compression:

Stored size: 360 Bytes

Contents

# frozen_string_literal: true

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

8 entries across 8 versions & 2 rubygems

Version Path
pundit-2.4.0 lib/generators/pundit/policy/policy_generator.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/pundit-2.2.0/lib/generators/pundit/policy/policy_generator.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/pundit-2.2.0/lib/generators/pundit/policy/policy_generator.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/pundit-2.2.0/lib/generators/pundit/policy/policy_generator.rb
pundit-2.3.1 lib/generators/pundit/policy/policy_generator.rb
pundit-2.3.0 lib/generators/pundit/policy/policy_generator.rb
pundit-2.2.0 lib/generators/pundit/policy/policy_generator.rb
pundit-2.1.1 lib/generators/pundit/policy/policy_generator.rb