Skip to content

Sockets - Rosalyn#25

Open
ranuseh wants to merge 37 commits into
Ada-C11:masterfrom
ranuseh:master
Open

Sockets - Rosalyn#25
ranuseh wants to merge 37 commits into
Ada-C11:masterfrom
ranuseh:master

Conversation

@ranuseh

@ranuseh ranuseh commented Apr 29, 2019

Copy link
Copy Markdown

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I didn't have any custom methods in the model, but if I had to go back I would put the top 10 methods in model. This is a business related model that takes into account the number of votes. It would be appropriate to place there.
Describe how you approached testing that model method. What edge cases did you come up with? N/A
What are session and flash? What is the difference between them? Session is used to keep track of logged in user information. Flash is a special type of hash that is utilize to send one-time messages from the controllers to views. It is often used to denote overall success or failure when submitting forms. Flash is similar to session but the main difference is that with flash, data stored go away after the next request-response cycle.

What was one thing that you gained more clarity on through this assignment? | Gained a better understanding of seeding a database.
What is the Heroku URL of your deployed application? | https://secure-fjord-99174.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? | Overall its a great project. Very challenging with a short amount of time to complete it but that is not a huge negative.

@dHelmgren

Copy link
Copy Markdown

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Great! I love it!
Comprehension questions yes
General
Rails fundamentals (RESTful routing, use of named paths) Pretty good, see note tho.
Views are well-organized (DRY, use of semantic HTML, use of partials) I'd love to see you using more view partials.
Errors are reported to the user No
Business logic lives in the models Mostly, see comment.
Models are thoroughly tested, including relations, validations and any custom logic No, model testing is very insubstantial.
Controllers are thoroughly tested, including the login/logout process and multi-step workflows like voting for a work yes, I see that a lot of good work went into your controller testing.
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
A user cannot vote for the same media more than once They cannot, but no messaging to tell them what went wrong.
All media lists are ordered by vote count On all media yes, main page no.
Splash page contains a media spotlight Yes.
Wave 3 - Users and Votes
Media pages contain lists of voting users yes
Individual user pages and the user list are present Going to a user page 404s.
Optional - Styling
Bootstrap is used appropriately yes
Look and feel is similar to the original yes
Overall This submission has a ton of good stuff in it, but a few key things tell me there is still learning to be done. Specifically, the NoMethodError that stops the User's page from loading is concerning, and I see a lot of places where you could work on DRYing things up. I'm concerned by the level of model testing I see. As a final note: don't forget to spot check things once you've deployed! It's always hard to see a red grade come down, but don't be discouraged, this stuff is easy to fix and improve. I fully expect you to be back kicking butt next assignment.

Comment thread config/routes.rb
root 'homepages#index', as: 'home'

resources :works
resources :users

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think you need all 7 restful routes for users - only index and show are needed for this project.

//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives. //= require jquery3
//= require popper

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I wonder if you tested your heroku deployment, because a few of your routes are broken because of an error we made with this file. See me about how to fix the error!

When you deploy a project, it's worth taking a 5 minute tour to make sure your crud still works!

<td><%= album.number_of_votes %></td>
<td><%= link_to "#{album.title}", work_path(album.id) %></td>
<td><%= album.creator %></td>
<td><%= album.publication_year%></td>

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 have the same code to show a list of works repeated 3 times. Could you use a view partial or a loop to DRY this up?

end

def top_ten_albums
@albums = Work.where(category: 'album')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Repeated code here, is there any way to dry these functions up?

def top_ten_movies
@movies = Work.where(category: 'movie')
@top_ten_movies = @movies.sort_by(&:number_of_votes).first(10)
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.

This function is right on the edge of what I'd tell you to definitely put in the Model.

Comment thread test/models/work_test.rb
require "test_helper"

describe Work do
let(:work) { Work.new(title: "some title", category: "album") }

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 pretty flimsy testing. You need to test the negative cases here too!

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