tinyduypham / incognitochat

0 stars 1 forks source link

assignment 2 - incognitochat #1

Open tinyduypham opened 8 years ago

tinyduypham commented 8 years ago

@coderschoolreview

this is my assignment for week 2, thank for your reviews.

coderschoolreview commented 8 years ago

Thank you for your Ruby submission, duyphamattinypulsecom!

:star: Everything looks good with the format of your submission. We'll be providing a detailed review soon!

chug2k commented 8 years ago

Good work, and sorry for the slow review! This homework is on authentication, using ActiveRecord::Relation, dealing with model associations, using partials, and the items under Bonus help with upcoming topics we will cover.

I like your minimal style. ;) Good job with getting the requirements of the app correct.

Suggestions

if !m.read && m.receiver_id == session[:user_id]

you can do

if !m.read && m.receiver == current_user

Also along those lines you can compare objects instead of ids. For example,

relation.to.id == current_user.id

can become

relation.to == current_user

It's just a tiny bit cleaner.