lib/souls/generate/policy.rb in souls-0.20.2 vs lib/souls/generate/policy.rb in souls-0.20.3
- old
+ new
@@ -1,10 +1,10 @@
module Souls
module Generate
class << self
## Generate Policy
def policy class_name: "souls"
- dir_name = "#{__dir__}/app/policies"
+ dir_name = "./app/policies"
FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
file_path = "#{dir_name}/#{class_name.singularize}_policy.rb"
File.open(file_path, "w") do |f|
f.write <<~EOS
class #{class_name.camelize}Policy < ApplicationPolicy