Class: Booking
Overview
This represents 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
Constructor Details
Instance Method Details
- (Object) build_period(attributes = {})
45 46 47 48 49 50 51 |
# File 'app/models/booking.rb', line 45 def build_period(attributes = {}) if free_slot.nil? super else super(attributes.merge(starts_at: free_slot.period.starts_at, ends_at: free_slot.period.ends_at)) end end |