Class: Booking

Inherits:
Slot
  • Object
show all
Defined in:
app/models/booking.rb

Overview

This represents a booking.

A kind of Slot that represents the Booking that a Customer reserves with a service Provider.

Schema Information

Table name: slots

id                 :integer          not null, primary key
capacity           :integer          default("1")
min_booking_length :integer          default("15")
created_at         :datetime         not null
updated_at         :datetime         not null
slot_group_id      :integer
color_id           :integer          not null
type               :string           not null
provider_id        :integer
booking_state_id   :integer
period_id          :integer          not null
affiliation_id     :integer
free_slot_id       :integer

Instance Method Summary (collapse)

Methods inherited from Slot

#respects_min_booking_length

Constructor Details

- (Booking) initialize

Returns a new instance of Booking



40
41
42
43
44
# File 'app/models/booking.rb', line 40

def initialize(*)
  super
  self.color ||= Color.blue
  self.booking_state ||= BookingState.pending
end