Fix indentation of case ... when statements
Get rid of unnecessary line wraps

These line wraps are no longer needed after the indentation is fixed.
Reused existing local variable
Merge pull request #1688 from zhangsu/case_indentation_fix

Refactor GradersController#global_actions
Refactor assignment model constraints and queries

Constraints are easier to make sense of when grouped by the
attribute that they are constraining.

Many of the query styles that will be deprecated in Rails 4 have
been updated. Though, some cannot be upgraded now as the API does
not yet exist.