From abc26f733f1aff9c4161702fe5d629c4abc88d16 Mon Sep 17 00:00:00 2001 From: ricola Date: Sun, 6 Apr 2025 17:04:31 -0600 Subject: [PATCH] Create model for organizers --- db/schema.rb | 9 ++++++++- views/votes_show.erb | 18 +++++++++++++++++- vote.rb | 19 +++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 887f52a..c5b9cd1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2025_03_22_172051) do +ActiveRecord::Schema[7.2].define(version: 2025_03_28_010547) do create_table "candidates", force: :cascade do |t| t.integer "vote_id" t.string "name" @@ -20,6 +20,13 @@ ActiveRecord::Schema[7.2].define(version: 2025_03_22_172051) do t.index ["vote_id"], name: "index_candidates_on_vote_id" end + create_table "organizers", force: :cascade do |t| + t.integer "vote_id" + t.integer "user_id" + t.index ["user_id"], name: "index_organizers_on_user_id" + t.index ["vote_id"], name: "index_organizers_on_vote_id" + end + create_table "ratings", force: :cascade do |t| t.integer "user_id" t.integer "candidate_id" diff --git a/views/votes_show.erb b/views/votes_show.erb index fdb8ba1..2c9f763 100644 --- a/views/votes_show.erb +++ b/views/votes_show.erb @@ -2,10 +2,26 @@

<%= @vote.description %>

-

Hello, <%= current_user.email %>.

+

Organizers

+ + + +
+

+ + +

+ +

Your ratings

+

Hello, <%= current_user.email %>.

+