Sha256: 7026dc5fffb89b576699b546e2343ff9024110dee97fdb8e6c1f90c317289ab6
Contents?: true
Size: 580 Bytes
Versions: 14
Compression:
Stored size: 580 Bytes
Contents
# frozen_string_literal: true require "rails/generators" module ActionPolicy module Generators class PolicyGenerator < ::Rails::Generators::NamedBase source_root File.expand_path("templates", __dir__) def run_install_if_needed in_root do return if File.exist?("app/policies/application_policy.rb") end generate "action_policy:install" end 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
14 entries across 14 versions & 1 rubygems