At generation sample job with crono #10

Closed
opened 2025-12-29 00:21:10 +01:00 by adam · 0 comments
Owner

Originally created by @michaelachrisco on GitHub (Apr 6, 2015).

At rails generate crono:install
I think that the gem should create an example job for the rails project within the app folder.

For example:

$ rails generate crono:install

Should create:

# app/crono_jobs/test.rb
module CronoJobs
class Test < ActiveJob::Base
  def perform
    # put you scheduled code here
    # Comments.deleted.clean_up...
    fail 'You forgot to set up your crono job...'
  end
end
#config/cronotab.rb
include CronoJobs
Crono.perform(CronoJobs::Test).every 2.days, at: {hour: 15, min: 30}
Originally created by @michaelachrisco on GitHub (Apr 6, 2015). At `rails generate crono:install` I think that the gem should create an example job for the rails project within the app folder. For example: ``` Bash $ rails generate crono:install ``` Should create: ``` # app/crono_jobs/test.rb module CronoJobs class Test < ActiveJob::Base def perform # put you scheduled code here # Comments.deleted.clean_up... fail 'You forgot to set up your crono job...' end end ``` ``` #config/cronotab.rb include CronoJobs Crono.perform(CronoJobs::Test).every 2.days, at: {hour: 15, min: 30} ```
adam added the enhancement label 2025-12-29 00:21:10 +01:00
adam closed this issue 2025-12-29 00:21:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/crono#10