Manuel Bustillo 9035df5178
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m18s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m28s
Run unit tests / unit_tests (pull_request) Successful in 1m0s
Install shoulda matchers, improve guests specs and change enum syntax
2024-11-09 17:45:23 +01:00

20 lines
335 B
Ruby

# Copyright (C) 2024 Manuel Bustillo
class Guest < ApplicationRecord
belongs_to :group
enum :status, {
considered: 0,
invited: 10,
confirmed: 20,
declined: 30,
tentative: 40
}
scope :potential, -> { where.not(status: %i[declined considered]) }
def full_name
"#{first_name} #{last_name}"
end
end