Add TicketType model with validations and fix dropdown menu
- Create TicketType model with Party association and Ticket relationship - Add comprehensive validations for name, description, pricing, and date ranges - Generate migration for ticket_types table with all required fields - Add Alpine.js import to fix dropdown menu functionality - Update ticket model with validations for qr_code, price, and status
This commit is contained in:
17
db/migrate/20250823170408_create_ticket_types.rb
Normal file
17
db/migrate/20250823170408_create_ticket_types.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class CreateTicketTypes < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :ticket_types do |t|
|
||||
t.references :party, null: false, foreign_key: true
|
||||
t.string :name
|
||||
t.text :description
|
||||
t.integer :price_cents
|
||||
t.integer :quantity
|
||||
t.datetime :sale_start_at
|
||||
t.datetime :sale_end_at
|
||||
t.boolean :requires_id
|
||||
t.integer :minimum_age
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
9
db/migrate/20250823171354_create_tickets.rb
Normal file
9
db/migrate/20250823171354_create_tickets.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class CreateTickets < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :tickets do |t|
|
||||
t.string :qr_code
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user