Class: BookingState

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

Overview

The state of a Booking on the system.

Instances of states should be unique among the system. Use singleton methods such as pending to retrieve them.

Schema Information

Table name: booking_states

id         :integer          not null, primary key
label      :string           not null
created_at :datetime         not null
updated_at :datetime         not null

Indexes

index_booking_states_on_label  (label) UNIQUE

Class Method Summary (collapse)

Class Method Details

+ (Object) accepted



29
30
31
# File 'app/models/booking_state.rb', line 29

def self.accepted
  find_by! label: 'accepted'
end

+ (Object) cancelled



37
38
39
# File 'app/models/booking_state.rb', line 37

def self.cancelled
  find_by! label: 'cancelled'
end

+ (Object) pending



25
26
27
# File 'app/models/booking_state.rb', line 25

def self.pending
  find_by! label: 'pending'
end

+ (Object) rejected



33
34
35
# File 'app/models/booking_state.rb', line 33

def self.rejected
  find_by! label: 'rejected'
end