Sha256: 96e843da621384dc48295f13d8bd741ac4fe4ab4f8d3ea0f55c10e90a0ca663a

Contents?: true

Size: 311 Bytes

Versions: 6

Compression:

Stored size: 311 Bytes

Contents

# vim:fileencoding=utf-8

class User < ActiveRecord::Base
  after_create :schedule_send_email

  private

  def schedule_send_email
    name = "send_email_#{id}"
    config = {}
    config[:class] = 'SendEmailJob'
    config[:args] = id
    config[:every] = '1d'
    Resque.set_schedule(name, config)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
resque-scheduler-4.2.1 examples/dynamic-scheduling/app/models/user.rb
resque-scheduler-4.2.0 examples/dynamic-scheduling/app/models/user.rb
resque-scheduler-4.1.0 examples/dynamic-scheduling/app/models/user.rb
resque-scheduler-4.0.0 examples/dynamic-scheduling/app/models/user.rb
resque-scheduler-3.1.0 examples/dynamic-scheduling/app/models/user.rb
resque-scheduler-3.0.0 examples/dynamic-scheduling/app/models/user.rb