Module: Coupler::Models::Jobify

Included in:
Import, Resource, Scenario
Defined in:
lib/coupler/models/jobify.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/coupler/models/jobify.rb', line 4

def self.included(base)
  base.one_to_many :jobs
  base.one_to_many(:running_jobs, {
    :class => "Coupler::Models::Job",
    :conditions => { :status => 'running' }, :read_only => true
  })
  base.one_to_many(:scheduled_jobs, {
    :class => "Coupler::Models::Job",
    :conditions => { :status => 'scheduled' }, :read_only => true
  })
end