Time - Yesenia#45
Open
yesentorres wants to merge 51 commits into
Open
Conversation
Media RankerFunctional Requirements: Manual Testing
Major Learning Goals/Code Review
Previous Rails learning, Building Complex Model Logic, DRYing up Rails Code
Testing Rails Apps
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
SummaryNicely done, you hit all the learning goals here. You don't have controller tests, but otherwise this is outstanding. Take a look at my comments and let me know what questions you have. |
CheezItMan
reviewed
May 30, 2020
| @@ -0,0 +1,15 @@ | |||
| Rails.application.routes.draw do | |||
| @@ -0,0 +1,7 @@ | |||
| require "test_helper" | |||
|
|
|||
| describe UsersController do | |||
| @@ -0,0 +1,7 @@ | |||
| require "test_helper" | |||
|
|
|||
| describe WorksController do | |||
|
|
||
| has_many :votes, dependent: :destroy | ||
|
|
||
| def self.sort_works(category) |
There was a problem hiding this comment.
Suggestion, make the valid categories a constant array and then you can check to see if the category is valid with CATEGORIES.include? category
Then you can use the variable with self.where(category: category)
|
|
||
| def show | ||
| if @work.nil? | ||
| render_not_found |
| return | ||
| else | ||
| flash.now[:error] = "A problem occured: Could not create #{@work.category}" | ||
| render :new |
There was a problem hiding this comment.
Suggested change
| render :new | |
| render :new, status: :bad_request |
| return | ||
| else | ||
| flash.now[:error] = "A problem occured: Could not update #{@work.category}" | ||
| render :edit |
There was a problem hiding this comment.
Suggested change
| render :edit | |
| render :edit, status: :bad_request |
| # create instance variable to pass the vote errors to the views | ||
| @invalid_vote_message = @vote.errors.messages | ||
|
|
||
| render :show |
There was a problem hiding this comment.
Suggested change
| render :show | |
| render :show, status: :bad_request |
| <% if books.instance_of? String %> | ||
| <p><%= books %></p> | ||
| <% else %> | ||
| <ul class="list-group top-ten__list"> |
There was a problem hiding this comment.
This part can be done with a partial view.
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?Assignment Submission: Media Ranker
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
sessionandflash? What is the difference between them?