The current implementation accepts only "admin" user. Codes for the
restriction exist in several files.
This change converges codes for the restriction to
app/models/user.rb. This change will be helpful when we support more
user names.
`Object#try` checks "whether receiver is nil or not". It doesn't rescue
any exceptions raised in method call.
> User.new(name: "admin", password_digest: "invalid-hash").authenticate("X")
BCrypt::Errors::InvalidHash: invalid hash
from /var/lib/gems/2.1.0/gems/bcrypt-3.1.7/lib/bcrypt/password.rb:60:in `initialize'
...