-
Notifications
You must be signed in to change notification settings - Fork 48
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
base: master
Are you sure you want to change the base?
Conversation
Preliminary setup of works, sessions, and users controllers
Created routes for sessions and added content to views to track sessions
Fixed bug in Works#create
…ethods - passing all
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
Added setting of date when vote is instantiated
Created users index view and fixed bug in work show view's table
…ount for the change
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
…p tests and forms
Media RankerWhat We're Looking For
|
</tr> | ||
</thead> | ||
<tbody> | ||
<% Work.list_of(category).each do |work| %> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 } |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
session
andflash
? What is the difference between them?flash
, except that the data persists beyond the next request-response cycle. Flash data is tracked only through the next request-response cycle.