Class: Moist::Scheduler

Inherits:
Object
  • Object
show all
Defined in:
lib/moist/scheduler.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject



3
4
5
# File 'lib/moist/scheduler.rb', line 3

def self.run
  new.run
end

Instance Method Details

#runObject



7
8
9
10
11
12
13
# File 'lib/moist/scheduler.rb', line 7

def run
  ::Moist::Campaign.where(enabled: true).each do |campaign|
    campaign.subscribers.each do |subscriber|
      tick!(subscriber)
    end
  end
end