Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions app/controllers/bookings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,17 @@ def booking_params
:assistance_donate,
:assistance_claim,
:single_person,
:dog)
:dog,
:lark_or_owl,
:massage_house,
:late_n_loud,
:chillout_house,
:dog_house,
:hot_tub_house,
:family_room,
:sharing_with,
:sharing_bed,
:comments)
end

def new_booking
Expand All @@ -67,6 +77,17 @@ def new_booking
assistance_donate: params[:booking][:assistance_donate],
assistance_claim: params[:booking][:assistance_claim],
single_person: params[:booking][:single_person],
dog: params[:booking][:dog])
dog: params[:booking][:dog],
lark_or_owl: params[:booking][:lark_or_owl],
massage_house: params[:booking][:massage_house],
late_n_loud: params[:booking][:late_n_loud],
chillout_house: params[:booking][:chillout_house],
dog_house: params[:booking][:dog_house],
hot_tub_house: params[:booking][:hot_tub_house],
family_room: params[:booking][:family_room],
sharing_with: params[:booking][:sharing_with],
sharing_bed: params[:booking][:sharing_bed],
comments: params[:booking][:comments]
)
end
end
3 changes: 2 additions & 1 deletion app/models/booking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ class Booking < ApplicationRecord
belongs_to :user
belongs_to :event

validates :arrival, :departure, :cancellable, :assistance_claim, :single_person, :dog, presence: true
validates :arrival, :departure, :cancellable, :assistance_claim, :single_person, :dog, :lark_or_owl, :massage_house,
:late_n_loud, :chillout_house, :dog_house, :hot_tub_house, :family_room, presence: true
end
22 changes: 22 additions & 0 deletions db/migrate/20241117164534_add_requests_to_bookings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class AddRequestsToBookings < ActiveRecord::Migration[7.1]
def change
create_enum :lark_or_owl, ["lark", "owl", "neither"]
create_enum :massage_house, ["yes", "no", "don't mind"]
create_enum :late_n_loud, ["yes", "no", "don't mind"]
create_enum :chillout_house, ["yes", "no", "don't mind"]
create_enum :hot_tub_house, ["yes", "no", "don't mind"]
create_enum :sharing_bed, ["double", "two singles"]
create_enum :dog_house, ["yes", "no", "don't mind"]

add_column :bookings, :lark_or_owl, :enum, enum_type: :lark_or_owl, null: false
add_column :bookings, :massage_house, :enum, enum_type: :massage_house, null: false
add_column :bookings, :late_n_loud, :enum, enum_type: :late_n_loud, null: false
add_column :bookings, :chillout_house, :enum, enum_type: :chillout_house, null: false
add_column :bookings, :dog_house, :enum, enum_type: :dog_house, null: false
add_column :bookings, :hot_tub_house, :enum, enum_type: :hot_tub_house, null: false
add_column :bookings, :family_room, :boolean
add_column :bookings, :sharing_with, :string
add_column :bookings, :sharing_bed, :enum, enum_type: :sharing_bed
add_column :bookings, :comments, :string
end
end
19 changes: 18 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.