Add validations.
DRY.
Rails associations. Some cleanup.
Move logic to models from controllers. DRY.
Merge pull request #16 from pavelperkin/add_missed_scopes_and_validations

Add missed scopes and validations. Cleanup. DRY.