Sha256: 188e32094e48ac7527fa893bfd0043295b7a92a3884ab1663237fc9249bc9304

Contents?: true

Size: 355 Bytes

Versions: 5

Compression:

Stored size: 355 Bytes

Contents

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

      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

5 entries across 5 versions & 2 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/pundit-1.1.0/lib/generators/pundit/policy/policy_generator.rb
pundit-1.1.0 lib/generators/pundit/policy/policy_generator.rb
pundit-1.0.1 lib/generators/pundit/policy/policy_generator.rb
pundit-1.0.0 lib/generators/pundit/policy/policy_generator.rb
pundit-0.3.0 lib/generators/pundit/policy/policy_generator.rb