Skip to content

Octos-Ari-MediaRanker#22

Open
arrriiii wants to merge 33 commits into
Ada-C9:masterfrom
arrriiii:master
Open

Octos-Ari-MediaRanker#22
arrriiii wants to merge 33 commits into
Ada-C9:masterfrom
arrriiii:master

Conversation

@arrriiii

@arrriiii arrriiii commented Apr 14, 2018

Copy link
Copy Markdown

Media Ranker

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a custom model method you wrote. I wrote a joined and date_voted method that returnsvthe date a 'work' was voted on (or user joined) by returning self.create_at.strftime('%m-%d-%Y).
Describe how you approached testing that model method. What edge cases did you come up with? Tested validations of each model before testing their methods. -- Checked for supported category type in Work class as well as an edge case for invalid category type.
What are session and flash? What is the difference between them? Flash is a special type of hash use to send one-time messages when sending a form.--Usually a success or failure. Session is also a hash-like object. Similar to flash, with the exception that the data does not go away after the next request-response cycle. It is stored indefinitely.
Describe a controller filter you wrote. I wrote a find_work method on the works controller that uses a before_action-- which is called in the designated methods before any other code is read.
What was one thing that you gained more clarity on through this assignment? How to utilize self in the model classes successfully and (un)restful routes.
What is the Heroku URL of your deployed application? https://rankster-app.herokuapp.com/ --Could not upload on heroku (working fine on rails server) ? Help!
Do you have any recommendations on how we could improve this project for the next cohort? There was a lot of material to cover in this project. --Would have enjoyed more time to nail down styling :)

@kariabancroft

Copy link
Copy Markdown

So it looks like your Heroku URL doesn't work because you don't have a root route set up. When I go to /works I see the splash page: https://rankster-app.herokuapp.com/works

@kariabancroft

Copy link
Copy Markdown

Media Ranker

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good
Comprehension questions Yes
General
Rails fundamentals (RESTful routing, use of named paths) Good
Semantic HTML Yes
Errors are reported to the user Yes - nice job using flash and the model errors
Business logic lives in the models Yes
Models are thoroughly tested, including relations, validations and any custom logic Not as much testing as I would like as this is one of the core learning goals of this assignment
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 - though the redirect doesn't work on Heroku so it appears like it doesn't work. But I see that when I log in the link changes to log out which is good.
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 - good job with this
All media lists are ordered by vote count Yes
Splash page contains a media spotlight Yes
Media pages contain lists of voting users No - showing the vote count but not the list of votes
Wave 3 - Styling
Foundation is used appropriately Yes
Look and feel is similar to the original Yes - not all of the bits and pieces are there but some
Overall Overall, you did a nice job working through the session bits and the CRUD actions. I'd like to see much more model testing in future projects. You should take a look at heroku logs in your terminal to see what the issue is with the main dashboard page, I don't see anything that is glaringly causing issues from the code.

Comment thread config/routes.rb
end


get "/works/:work_id/upvote", to: "votes#create", as: "upvote"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this route doing the same thing as the nested route within works?

<section class="top-five">
<h3>Top Movies</h3>
<ul>
<% unless Work.top_five_movie.nil? %>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this the only one that gets this special conditional? Would it make sense to have this on all of them?

<li>by <%= work.creator %></li>
<li><small>Votes: <%= work.votes.count %></small></li>
<% end %>
<% else %>

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 can't put an else after an end. There should only be an end` at the end of the whole block.

Comment thread app/models/work.rb

def self.albums
work = Work.where(category: 'album')
work.sort_by do |w|

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 should be able to use order_by instead which is more a bit more simplified ActiveRecord method of doing the same thing

Comment thread app/models/work.rb
has_many :votes, :dependent => :destroy

validates :title, presence: true, uniqueness: true
validates :category, inclusion: %w(movie book 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.

Good

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