-
Notifications
You must be signed in to change notification settings - Fork 0
Base models and migrations #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
| FactoryBot.define do | ||
| factory :room do | ||
| invite_code { SecureRandom.hex(10) } | ||
| venue { venue } |
Copilot
AI
Apr 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assignment 'venue { venue }' may lead to an unintended recursive reference. Consider using 'association :venue' or providing an explicit value to properly set up the association.
| venue { venue } | |
| association :venue |
| factory :room do | ||
| invite_code { SecureRandom.hex(10) } | ||
| venue { venue } | ||
| host_id { attendee } |
Copilot
AI
Apr 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assigning 'host_id' with 'attendee' is ambiguous; if host_id is intended to reference an Attendee's id, use an association (e.g., 'association :attendee') or assign the proper value explicitly.
| host_id { attendee } | |
| association :attendee, factory: :attendee, strategy: :build | |
| host_id { attendee.id } |
| class CreateVotes < ActiveRecord::Migration[7.1] | ||
| def change | ||
| create_table :votes do |t| | ||
| t.references :rooms_venues, null: false, foreign_key: true |
Copilot
AI
Apr 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reference name 'rooms_venues' is plural; Rails conventions suggest using a singular name (e.g., 'room_venue') to properly define the belongs_to association in the Vote model.
| t.references :rooms_venues, null: false, foreign_key: true | |
| t.references :room_venue, null: false, foreign_key: true |
Items Addressed
Out of Scope
Author Checklist
opensesame