Skip to content

Jocelyn Gonzalez -- Carets#33

Open
jocegonz wants to merge 19 commits intoAda-C8:masterfrom
jocegonz:master
Open

Jocelyn Gonzalez -- Carets#33
jocegonz wants to merge 19 commits intoAda-C8:masterfrom
jocegonz:master

Conversation

@jocegonz
Copy link

@jocegonz jocegonz commented Oct 16, 2017

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I created a method that sorted all the works by votes, from highest to lowest.
Describe how you approached testing that model method. What edge cases did you come up with? Ideally, every validation has at least two tests - one for an object that should work and one for an object that should be rejected. I tested to make sure my titles were unique and objects couldn't be created without a title.
Describe an edge case test you wrote for a controller If the page took an id, I tried to make sure it validated a good id and rejected a bad one.
What are session and flash? What is the difference between them? Flash is a one-time message based on the action completed. Session is persistent throughout your experience as a user. It ends when you logout.
Describe a controller filter you wrote. I didn't user controller filters
What was one thing that you gained more clarity on through this assignment? I'm glad I got more experience making a join table.
What is the Heroku URL of your deployed application https://media-ranker-jogo.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? I wish we had a tutor this weekend. I had so many bugs that took me hours to fix and it didn't allow me as much time to do everything I wanted. The session section of our github notes also felt pretty sparse.

@CheezItMan
Copy link

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene You should be committing more often. The commit messages are pretty good.
Comprehension questions Check, I'll communicate the desire for a Saturday tutor. We are looking. You should definitely use controller filters in the future. If you feel our notes are too sparse you can check out the Rails Guide.
General
Rails fundamentals (RESTful routing, use of named paths) Good RESTful routes
Semantic HTML Good semantic HTML
Errors are reported to the user If I create or edit a work with no title, I get an error screen and not a message about what's wrong. It does report double voting however.
Business logic lives in the models You have one piece of business logic in the Model. I would recommend a method for the spotlight.
Models are thoroughly tested, including relations, validations and any custom logic You've tested validations for the Work model, The other models are untested and you didn't test the relationships.
Controllers are thoroughly tested You're missing some negative tests for the WorksController and no tests for the other controllers. You should look through Works more carefully for the things that can go wrong and fix other controller tests.
Wave 1 - Media
Splash page shows the three media categories Check
Basic CRUD operations on media are present and functional Check
Wave 2 - Users and Votes
Users can log in and log out Check
The ID of the current user is stored in the session Check
Individual user pages and the user list are present Check
A user cannot vote for the same media more than once Check
All media lists are ordered by vote count Check
Splash page contains a media spotlight Check
Media pages contain lists of voting users Check
Wave 3 - Styling
Foundation is used appropriately Foundation is added, but not really styled much. Just the layout. It is nicely responsive.
Look and feel is similar to the original It looks like there's a lot of work left to do on the styling.
Overall You've got some things missing notably the testing and styling. Spend some time on bEtsy and MediaRankerOAuth writing some tests, especially model tests. Looking at MediaRankerOAuth is a good place to check to see, "am I missing some tests." Think like someone trying to ruin your site, look for things that could go wrong or be misused.

validates :title, presence: true
validates :title, uniqueness: true

def self.by_votes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use

Work.left_outer_joins(:votes).distinct.select('works.*, COUNT(votes.*) AS num_votes').group('works.id').order('num_votes DESC')

This would let Postgres do the sorting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants