Sha256: a1811b9166a75d3157668fe5213149219f5ed1d6256f860e99d0e3754123bfda

Contents?: true

Size: 323 Bytes

Versions: 5

Compression:

Stored size: 323 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
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pundit-0.2.3 lib/generators/pundit/policy/policy_generator.rb
pundit-0.2.2 lib/generators/pundit/policy/policy_generator.rb
pundit-0.2.1 lib/generators/pundit/policy/policy_generator.rb
pundit-0.2.0 lib/generators/pundit/policy/policy_generator.rb
pundit-0.1.0 lib/generators/pundit/policy/policy_generator.rb