Skip to content

Conversation

@Jackiesan
Copy link

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. The work model has a spotlight method to return the work with the most votes. I also created a method within that model to sort the works in descending order of works with the most votes to the least votes.
Describe how you approached testing that model method. What edge cases did you come up with? For the spotlight method I added data to my user, vote, work fixtures. I added several votes to the one of the books. In the test I called the method and asserted that it must equal the work that I assigned the most votes to. I didn't have time to test for an edge case but a good one would be to display none if the first one in the array has 0 votes, this means that my method will also need to change.
What are session and flash? What is the difference between them? A session tracks the users data meanwhile the user is in the browser (stored via cookies and sessions are a hash). Flash are notices or messages that appear on the browser once it completes a certain action or fails to. Flash messages are used to inform the user of failures or completed actions.
Describe a controller filter you wrote. I used a controller filter on the application controller to find a user. This means that before every single action in every single controller, my app will find a user first. This was done to keep track of the session.
What was one thing that you gained more clarity on through this assignment? I gained more clarity on fixtures and database seeds. I
What is the Heroku URL of your deployed application? https://da-best-media-ranker.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? I found it challenging to follow along with some of the ada books branches. Sometimes the code we did together in class didn't work so it was more difficult to learn some of these concepts.

Jackiesan added 30 commits April 9, 2018 14:42
@tildeee
Copy link

tildeee commented Apr 24, 2018

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene x
Comprehension questions x
General
Rails fundamentals (RESTful routing, use of named paths) x
Semantic HTML x
Errors are reported to the user x
Business logic lives in the models x
Models are thoroughly tested, including relations, validations and any custom logic x
Wave 1 - Media
Splash page shows the three media categories x
Basic CRUD operations on media are present and functional x
Wave 2 - Users and Votes
Users can log in and log out x
The ID of the current user is stored in the session x
Individual user pages and the user list are present x
A user cannot vote for the same media more than once x
All media lists are ordered by vote count x
Splash page contains a media spotlight x
Media pages contain lists of voting users x
Wave 3 - Styling
Foundation is used appropriately x
Look and feel is similar to the original x
Overall

Looks good! The site looks and functions as expected.

I think you hit all the major learning goals: advanced model & controller logic, styling, model testing.

Overall, good work!

<section>
<%= form_for @work do |f| %>
<%= f.label :category %>
<%= f.select :category, ['album', 'book', 'movie'] %>
Copy link

Choose a reason for hiding this comment

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

You hardcoded the list of categories here, but it might've been cool to find a rails form helper to populate a select with all unique categories that works have. ;) Just a thought.

class Work < ApplicationRecord
validates :title, presence: true
validates_uniqueness_of :title, scope: :category
validates :category, presence: true, inclusion: { in: %w(book movie album), message: "%{value} is not a valid category" }
Copy link

Choose a reason for hiding this comment

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

Looks great; but I wish %w(book movie album) were a constant!

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