class Rails::Generators::JobGenerator
:nodoc:
:nodoc:
:nodoc:
def self.default_generator_root
def self.default_generator_root __dir__ end
def application_job_file_name
def application_job_file_name @application_job_file_name ||= if mountable_engine? "app/jobs/#{namespaced_path}/application_job.rb" else "app/jobs/application_job.rb" end end
def create_job_file
def create_job_file template "job.rb", File.join("app/jobs", class_path, "#{file_name}_job.rb") in_root do if behavior == :invoke && !File.exist?(application_job_file_name) template "application_job.rb", application_job_file_name end end end
def file_name
def file_name @_file_name ||= super.sub(/_job\z/i, "") end