Sha256: 09675035d9a5eb44209c67a3473af16d9f303ba14658da1d12d0aa68a90bd95d

Contents?: true

Size: 713 Bytes

Versions: 3

Compression:

Stored size: 713 Bytes

Contents

# == 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
#

class ShiftTrade < ActiveRecord::Base

  belongs_to :candidate
  belongs_to :shift
  belongs_to :organization
  belongs_to :user
  validates_presence_of :candidate

  def affirm
    self.status = 'affirmative'
    save
  end

  def negate
    self.status = 'negative'
    save
  end

  def ignore
    self.status = 'ignored'
    save
  end

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

    self.candidate.confirm(self.id)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pshq_engine-0.1.6 app/models/shift_trade.rb
pshq_engine-0.1.5 app/models/shift_trade.rb
pshq_engine-0.0.1 app/models/shift_trade.rb