Skip to content

Caroline Nardi - MediaRanker - Octos#23

Open
cmn53 wants to merge 46 commits intoAda-C9:masterfrom
cmn53:master
Open

Caroline Nardi - MediaRanker - Octos#23
cmn53 wants to merge 46 commits intoAda-C9:masterfrom
cmn53:master

Conversation

@cmn53
Copy link
Copy Markdown

@cmn53 cmn53 commented Apr 14, 2018

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I wrote a custom model method to create an inner join between works and votes and order the works by the number of corresponding votes.
Describe how you approached testing that model method. What edge cases did you come up with? To test the model, I included works in the fixtures that had 0, 1, or 2 votes. I first tested that the works with 1 or 2 votes were included in the returned collection, then tested that a work with 0 votes was not included. I then tested if the works were returned in order from most to least votes. I tested two edge cases: the method returns an empty array if all works have no votes or if there are no works.
What are session and flash? What is the difference between them? Session and flash are hash-like objects that Rails gives us to persist data between requests. The difference between them is that data added to flash is only persisted through the end of the next request-response cycle (or the current cycle for flash.now), and data added to session is persisted until it is manually removed or the user closes their browser.
Describe a controller filter you wrote. I wrote a controller filter for the works controller that finds a work by the params-provided id before calling the show, edit, or new methods of that controller.
What was one thing that you gained more clarity on through this assignment? I think I gained a little more clarity about what code belongs in the controller v. the model.
What is the Heroku URL of your deployed application? https://hidden-plains-83044.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? I think I spent about 90% of my time on this project struggling with the error handling, and I still didn't get it right for the votes. This could have just been isolated to my experience, but a little more guidance about combining flash and error messages might have made things smoother.

cmn53 added 30 commits April 9, 2018 14:39
… view to show flash messages and have links respond to the session
…ser is deleted. Modified vote#create methods to redirect_back to existing page.
…n't figure out how to display it otherwise. Added and passed validation tests for users and works
@kariabancroft
Copy link
Copy Markdown

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good
Comprehension questions Good - thanks for the note about error handling
General
Rails fundamentals (RESTful routing, use of named paths) Good
Semantic HTML Yes - the works home page has good semantics whereas the works index page has some room for improvement
Errors are reported to the user Some - you are using flash within the controller, but then losing the model error messages. You can still use the error_messages partial in your form partials to show the more specific errors.
Business logic lives in the models Yes, nice job specifically in the Work model
Models are thoroughly tested, including relations, validations and any custom logic Your tests look SPECTACULAR
Wave 1 - Media
Splash page shows the three media categories Yes
Basic CRUD operations on media are present and functional YES
Wave 2 - Users and Votes
Users can log in and log out Yes
The ID of the current user is stored in the session Yes
Individual user pages and the user list are present Yes
A user cannot vote for the same media more than once Yes - nice job with the error message on this
All media lists are ordered by vote count Yes
Splash page contains a media spotlight Yes
Media pages contain lists of voting users Yes and it looks great
Wave 3 - Styling
Foundation is used appropriately Yes
Look and feel is similar to the original Yes!
Overall Overall, you rocked this assignment. You really hit all of the major learning goals as demonstrated by your thorough model testing and full functionality. Great job.

Copy link
Copy Markdown

@kariabancroft kariabancroft left a comment

Choose a reason for hiding this comment

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

Sorry about that - I forgot to submit these comments earlier

Comment thread config/routes.rb

resources :users, only: [:index, :show]

resources :votes, only: [:create]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you need this route as well as the nested one?

Comment thread app/models/work.rb
end

def self.ordered_inclusive
self.left_outer_joins(:votes).group(:id).order('COUNT(votes.id) DESC')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice!

@@ -0,0 +1,13 @@
<section>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Weird place to put this comment, but this file name should be _error_messages

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