Sha256: 30b418ac6fc2782f905fc0212dd2c45f61df0b289609875df4594e98965ea7ee
Contents?: true
Size: 559 Bytes
Versions: 6
Compression:
Stored size: 559 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 return if ::Rails.root.join("app/policies/application_policy.rb").exist? 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
6 entries across 6 versions & 1 rubygems