Class: Suspenders::JobsGenerator
Instance Method Summary
collapse
default_source_root, inherited
#bundle_command
Methods included from Actions
#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file
Instance Method Details
#add_jobs_gem ⇒ Object
5
6
7
8
|
# File 'lib/suspenders/generators/jobs_generator.rb', line 5
def add_jobs_gem
gem "delayed_job_active_record"
Bundler.with_unbundled_env { run "bundle install" }
end
|
21
22
23
24
25
26
|
# File 'lib/suspenders/generators/jobs_generator.rb', line 21
def configure_active_job
configure_application_file(
"config.active_job.queue_adapter = :delayed_job"
)
configure_environment "test", "config.active_job.queue_adapter = :inline"
end
|
10
11
12
|
# File 'lib/suspenders/generators/jobs_generator.rb', line 10
def configure_background_jobs_for_rspec
generate "delayed_job:active_record"
end
|
#initialize_active_job ⇒ Object
14
15
16
17
18
19
|
# File 'lib/suspenders/generators/jobs_generator.rb', line 14
def initialize_active_job
copy_file(
"active_job.rb",
"config/initializers/active_job.rb"
)
end
|