class DelayedJob::CronGenerator

Public Class Methods

next_migration_number(dirname) click to toggle source
# File lib/generators/delayed_job/cron_generator.rb, line 20
def self.next_migration_number(dirname)
  ActiveRecord::Generators::Base.next_migration_number(dirname)
end

Public Instance Methods

create_migration_file() click to toggle source
# File lib/generators/delayed_job/cron_generator.rb, line 14
def create_migration_file
  migration_template('cron_migration.rb',
                     'db/migrate/add_cron_to_delayed_jobs.rb',
                     migration_version: migration_version)
end

Private Instance Methods

migration_version() click to toggle source
# File lib/generators/delayed_job/cron_generator.rb, line 26
def migration_version
  if ActiveRecord::VERSION::MAJOR >= 5
    "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
  end
end