Class: DataMiner::Run

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/data_miner/run.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_tablesObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/data_miner/run.rb', line 10

def create_tables
  return if table_exists? and column_names.include?('skipped') # force a drop
  connection.create_table 'data_miner_runs', :force => true do |t|
    t.string 'resource_name'
    t.boolean 'killed'
    t.boolean 'skipped'
    t.boolean 'finished'
    t.datetime 'started_at'
    t.datetime 'terminated_at'
    t.datetime 'created_at'
    t.datetime 'updated_at'
  end
  reset_column_information
end

Instance Method Details

#resourceObject



5
6
7
# File 'lib/data_miner/run.rb', line 5

def resource
  resource_name.constantize
end