Class: ShiftTrade

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/shift_trade.rb

Overview

Schema Information

Table name: shift_trades

id           :integer          not null, primary key
status       :string(255)      default("initial")
candidate_id :integer
shift_id     :integer
created_at   :datetime
updated_at   :datetime

Instance Method Summary collapse

Instance Method Details

#affirmObject



21
22
23
24
# File 'app/models/shift_trade.rb', line 21

def affirm
  self.status = 'affirmative'
  save
end

#confirmObject



36
37
38
39
40
41
# File 'app/models/shift_trade.rb', line 36

def confirm()
  self.status = 'confirmed'
  save

  self.candidate.confirm(self.id)
end

#ignoreObject



31
32
33
34
# File 'app/models/shift_trade.rb', line 31

def ignore
  self.status = 'ignored'
  save
end

#negateObject



26
27
28
29
# File 'app/models/shift_trade.rb', line 26

def negate
  self.status = 'negative'
  save
end