Wasasando

Model creation

I'm building an app for my oldest daughter who is a competitive swimmer. The app will allow her to track each meet and every race. Eventually, the plan is to show her progress, trends using graphs, and track her points for State.

Currently I have two models:
First is for Events (or race)

create_table "events", force: :cascade do |t|
t.string "style"
t.string "distance"
t.string "seed_time"
t.string "time"
t.string "heat_place"
t.string "overall"
t.boolean "team"
t.string "points"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

The next model is for meets

create_table "meets", force: :cascade do |t|
t.string "host_team"
t.string "event_name"
t.string "event_location"
t.date "date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

The goal is to simplify inputing the race information. She's 8 yo and I want to allow her to choose from swimming styles (i.e. freestyle, breaststroke...) I pre-populate in order to sustain continuity.
Do I need to create a new model that is specific to "Style"? Or Can I build into the form the ability to choose from a dropdown?

create_table "styles", force: :cascade do |t|
t.string "style"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

Same question with distance:
In the US, most of the pools are measured in yards (which is really $#@%ing annoying)
Is it better to create another model specifically for distance?

create_table "distance", force: :cascade do |t|
t.string "distance"
t.string "measurement"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

And Should Event look like this:

create_table "events", force: :cascade do |t|
t.string "seed_time"
t.string "time"
t.string "heat_place"
t.string "overall"
t.boolean "team"
t.string "points"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

Am I overthinking this????
Any help would be greatly appreciated.

Exit mobile version