Skip to content

pipes | Tanisha | media ranker#42

Open
tanham wants to merge 106 commits intoAda-C8:masterfrom
tanham:master
Open

pipes | Tanisha | media ranker#42
tanham wants to merge 106 commits intoAda-C8:masterfrom
tanham:master

Conversation

@tanham
Copy link
Copy Markdown

@tanham tanham commented Oct 17, 2017

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. Due to time, I have not yet created any custom models. When I return to this project, I will write a method in the work model to sort the works by votes and methods to get the top ten work of each category.
Describe how you approached testing that model method. What edge cases did you come up with? I tested if the work description length is more than 500 characters
Describe an edge case test you wrote for a controller In the main controller, I checked to make sure that it returned a success even if there were no records
What are session and flash? What is the difference between them? Flash sends messages from the controller to the view between one request to the other. Session keeps track of a user's data until the session is over (i.e if they log out or close the browser)
Describe a controller filter you wrote. I have not yet dried my code up with controller filters.
What was one thing that you gained more clarity on through this assignment? During this project, I got caught up on a routes issues for hours. The bug was that I kept going to users/login instead of /login. I went down the path of trying to make users/login work instead of the proper route. Once I figured out I was going using the wrong route, I easily solved my problem. Debugging my routes helped me to understand rails routes better. I also used the better errors shell and rails console a ton more to debug during this project.
What is the Heroku URL of your deployed application https://tanham-media-ranker.herokuapp.com
Do you have any recommendations on how we could improve this project for the next cohort?

@droberts-sea
Copy link
Copy Markdown

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene yes
Comprehension questions yes
General
Rails fundamentals (RESTful routing, use of named paths) yes
Semantic HTML mostly good - see inline comments
Errors are reported to the user yes
Business logic lives in the models no - As you indicate in your PR, good candidates here would be a method to get the top 10 media for a given category, or the top media overall.
Models are thoroughly tested, including relations, validations and any custom logic some - Missing tests around relations. If business logic were to be moved here it would need tests.
Controllers are thoroughly tested yes - there's a little missing coverage, but in general this looks good
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
All media lists are ordered by vote count yes
Splash page contains a media spotlight yes
Media pages contain lists of voting users yes
Wave 3 - Styling
Foundation is used appropriately some - many pages are not
Look and feel is similar to the original some
Overall Good job overall. This is a big, difficult project, and while some of the pieces weren't quite there (particularly around styling and moving work to the Model), you were able to get the core functionality working. This is no mean feat. Make sure you take the opportunity to practice these on the bEtsy project, and keep up the hard work!

</section>
</main>

<%= yield %>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This yield should probably be inside your <main> section


<p>Top Books</p>
<ul>
<% @books.each do |work| %>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Each of these media types could probably be its own <section>

def show
@work = Work.find_by(id: params[:id])
unless @work
head :not_found
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You might DRY this code up using a controller filter.

@works = works.sort_by {|work| -work.votes.count}
movies = Work.where(category: "movie")
@movies = movies.sort_by {|work| -work.votes.count}
books = Work.where(category: "book")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is definitely all functionality that ought to be in the model, but I still like it better here than if you had done it in the view.

must_redirect_to root_path

User.count.must_equal start_user_count + 1
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It might also be interesting to test logging in an existing user.

work_id = Work.first.id
delete work_path(work_id)
must_respond_with :redirect
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What happens if you attempt to destroy a work that has votes? Can you do it? What happens to those votes?

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