Proposal has_many :speakers #664
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
While the norm tends to be for a proposal to have a single speaker, there are also sometimes panel discussions or presentations involving 2-4 presenters. As such we want to support associating multiple speakers to a single proposal.
Why was this work done? Is there a related Issue?
Add support for multiple speakers to one proposal
Where should a reviewer start?
Are there any manual testing steps?
There's one area of visual concern that I'd appreciate some feedback on. The new/edit proposal form allows you to select multiple speakers from the dropdown, but visually it's not very clear. I wasn't able to find anything in the documentation of getskeleton to provide a good visual for multiple-select, so not terribly certain what to do here.
There's also the additional wrinkle that my other (slightly infamous) PR, Add passwordless for authentication, removes the ability to specify a speaker under the assumption it will be the current user. So I'll need to revisit that to bring back the speaker selection, but ensure that the current user/speaker is always included in the list.
Screenshots
N/A
Deployment instructions
In addition to the database migration to create the
proposal_speakerstable, I added a rake task (migrate:speakers) to map the current speaker-proposal data into the new join table. That rake task would need to be run after the database migration is completed in order to retain the current mapping between Proposals and SpeakersAt some future point after this PR is merged, there could be a follow-up PR to remove the
speaker_idcolumn from the proposals table.Database changes
There's a new database table, proposal_speakers, which serves as the join table between the Proposal and Speaker models to allow for an arbitrary number of speakers on a single Proposal record.
New ENV variables
N/A