Jacquelyn Cheng - MediaRanker - Nodes#27
Open
jacquelynoelle wants to merge 67 commits intoAda-C10:masterfrom
Open
Jacquelyn Cheng - MediaRanker - Nodes#27jacquelynoelle wants to merge 67 commits intoAda-C10:masterfrom
jacquelynoelle wants to merge 67 commits intoAda-C10:masterfrom
Conversation
Preliminary setup of works, sessions, and users controllers
Created routes for sessions and added content to views to track sessions
Fixed bug in Works#create
…ethods - passing all
Merging completed restful Work controller methods
Added tests for title uniqueness validation within category - passing test
Added user and vote yml data and relationship tests for work
Added feature to allow users to only vote once per work
Added setting of date when vote is instantiated
Created users index view and fixed bug in work show view's table
…ount for the change
Models - tests and DRYing up code
Merging development branch with master for deployment
Applied bootstrap classes across site, starter css styling
Applied bootstrap to front-end, some preliminary styling complete
Finalized front-end to match example site
…p tests and forms
Media RankerWhat We're Looking For
|
CheezItMan
reviewed
Oct 24, 2018
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <% Work.list_of(category).each do |work| %> |
There was a problem hiding this comment.
Notice how these tables are repetitive. You could DRY them up quite a bit by using a partial view.
| belongs_to :user | ||
| belongs_to :work | ||
|
|
||
| validates :user, presence: true |
There was a problem hiding this comment.
Because a vote belongs to a user, the requirement for it to be present is already there.
|
|
||
| validates :category, presence: true | ||
| validates :title, presence: true | ||
| validates :title, uniqueness: { scope: :category } |
|
|
||
| private | ||
|
|
||
| def self.sort_by_votes(work_list) # ties are displayed in alphabetical order |
| votes = user.votes | ||
|
|
||
| # Assert | ||
| expect(user).must_be_instance_of User |
There was a problem hiding this comment.
Since you're pulling user from fixtures, you don't need to verify that it's a User model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?flash, except that the data persists beyond the next request-response cycle. Flash data is tracked only through the next request-response cycle.