Time - Sharon Cheung#33
Open
sharonkeikei wants to merge 43 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. Well done. Excellent work. Take a look at my comments, mostly regarding routes.rb and some other minor issues. |
CheezItMan
reviewed
May 31, 2020
| resources :works do | ||
| get '/upvote', to: "votes#upvote", as: 'upvote' | ||
| end | ||
| resources :users |
| post "/login", to: "users#login" | ||
| post "/logout", to: "users#logout" | ||
|
|
||
| get '/homepages', to: 'homepages#index', as: 'homepages' |
There was a problem hiding this comment.
If you have homepages#index as the route route, do you need this?
| describe 'custom method' do | ||
| describe 'self.check_exisiting_vote(current_user_id, work_id)' do | ||
|
|
||
| it 'will return true if there is already an exisitng vote for that specific user and work' do |
There was a problem hiding this comment.
Suggested change
| it 'will return true if there is already an exisitng vote for that specific user and work' do | |
| it 'will return true if there is already an existing vote for that specific user and work' do |
|
|
||
| def self.sort_by_vote_order | ||
| work = Work.all | ||
| return work.sort_by{|work| work.votes.count}.reverse |
There was a problem hiding this comment.
Just noting that it's more efficient to do this with .order and other methods to have Postgres do the filtering and sorting. Postgres is much better at it.
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!
My ERD for Media Ranker
https://app.lucidchart.com/documents/edit/d5307ecf-19e4-4c50-ad9a-04473b83720c/0_0?beaconFlowId=56D1F03507703A99#?folder_id=home&browser=icon
Comprehension Questions
sessionandflash? What is the difference between them?