Refactor a handful more models

Group attribute constraints by attribute, and update some database
queries for Rails 4.
Extra blank line detected.