Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jacquelyn Cheng - MediaRanker - Nodes #27

Open
wants to merge 67 commits into
base: master
Choose a base branch
from

Conversation

jacquelynoelle
Copy link

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I wrote a custom method to create a list of all the works within a designated category, ordered by votes and then alphabetically as the tiebreaker. This is business logic that is used repeatedly throughout the site.
Describe how you approached testing that model method. What edge cases did you come up with? I tested the nominal cases of returning a list of ONLY works within a certain category. I also tested the sorting to ensure it was returning a list ordered by votes then alphabetically as the tiebreaker. To do this, I set up votes and ties in my fixtures. I tested the edge case of there being no works within the selected category.
What are session and flash? What is the difference between them? A session is a type of hash-like-object used to track data throughout a users "session" (e.g. until browser close). It is similar to flash, except that the data persists beyond the next request-response cycle. Flash data is tracked only through the next request-response cycle.
Describe a controller filter you wrote. I wrote a controller filter find_work to find a work record by its id. This is used before several of the work controller actions.
What was one thing that you gained more clarity on through this assignment? I gained a lot more clarity on the role of controller methods because we created some controllers that had no models, and on the flip side I had a model (Vote) that did not require a controller.
What is the Heroku URL of your deployed application? http://top-media.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? I really liked this assignment! It might be easier to have a list of requirements rather than having to discover them via the site? Or have a check-in to make sure no one missed any.

jacquelynoelle and others added 30 commits October 8, 2018 14:50
Preliminary setup of works, sessions, and users controllers
Created routes for sessions and added content to views to track sessions
Merging completed restful Work controller methods
Added tests for title uniqueness validation within category - passing test
Added user and vote yml data and relationship tests for work
Added feature to allow users to only vote once per work
jacquelynoelle and others added 28 commits October 9, 2018 20:46
Added setting of date when vote is instantiated
Created users index view and fixed bug in work show view's table
Models - tests and DRYing up code
Merging development branch with master for deployment
Applied bootstrap classes across site, starter css styling
Applied bootstrap to front-end, some preliminary styling complete
Finalized front-end to match example site
@CheezItMan
Copy link

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits and good commit messages
Comprehension questions Check
General
Rails fundamentals (RESTful routing, use of named paths) Good routes and good use of named routes
Views are well-organized (DRY, use of semantic HTML, use of partials) You could make better use of partials in the table rendering.
Errors are reported to the user Check
Business logic lives in the models Check, nice work
Models are thoroughly tested, including relations, validations and any custom logic Solid model testing
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
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
Wave 3 - Users and Votes
Media pages contain lists of voting users Check
Individual user pages and the user list are present Check
Optional - Styling
Bootstrap is used appropriately Styling looks good
Look and feel is similar to the original Nice work it looks very close to the original
Overall Excellent work, you hit all the learning goals.

</tr>
</thead>
<tbody>
<% Work.list_of(category).each do |work| %>

Choose a reason for hiding this comment

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

Notice how these tables are repetitive. You could DRY them up quite a bit by using a partial view.

belongs_to :user
belongs_to :work

validates :user, presence: true

Choose a reason for hiding this comment

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

Because a vote belongs to a user, the requirement for it to be present is already there.


validates :category, presence: true
validates :title, presence: true
validates :title, uniqueness: { scope: :category }

Choose a reason for hiding this comment

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

👍


private

def self.sort_by_votes(work_list) # ties are displayed in alphabetical order

Choose a reason for hiding this comment

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

👍

votes = user.votes

# Assert
expect(user).must_be_instance_of User

Choose a reason for hiding this comment

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

Since you're pulling user from fixtures, you don't need to verify that it's a User model.

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