Fix some law of demeter violations
```
@post.user.username
```
is not good
```
delegate :username, to: :user, prefix: true
@post.user_username
```
is apparently good? Although I've never really seen the advantage since I feel like we're just masking an underlying problem. But at least it looks a little nicer.
See merge request !14
Layout fixes to be closer to reddit
Design setup closer to Reddit. Sidebar, header, posts, etc. Hacky for now. Fix later after spending more time in views.
See merge request !12
Add posts
Not complete, but implemented basic posting to subcreddits. Right now, links aren't taken into account (but basic modeling is in). Enough to continue.
See merge request !11
Notes on closing subcreddit:
This doesn't seem great. Would be slightly better if closed could be referenced
as true or false instead of '0' or '1' in the model. Testing this is a bit
messy, but Tiemcop makes it a bit better.
Notes on subcreddit validations:
This is still not ideal. For starters, from
http://guides.rubyonrails.org/active_record_validations.html:
"Note that some databases are configured to perform case-insensitive searches
anyway."
It also seems difficult to validate fields that are set in before_save since
validations occur before callbacks. Revisit this (perhaps friendly_id wll save
us).
Add user sessions
Although rails provides built-in user sessions, this allows us to add additional fields to the session model. For example, we can now track the user agent and IP address of all sessions associated with a user. Long term, this allows us to do neat things like session revocation (by both user and admin) and sudo mode.
See merge request !5
Add user creation
Adds simple creation of users that have a username, password, and an email. The password is managed by Rail's `has_secure_password`.
See merge request !2