exercism/exercism.io — pull request #2104 by bluerogue251 (2014-12-09 04:26:06+00:00)
Title: Simplify username finder queries

citext making things simpler :-)

Before, LOWER(username) had to be called for SQL queries finding users
in order for a case-sensitive match to be used.

Now that the users.username column is citext, the case insensitive
matching is taken care of automatically by the database and we can thus
simplify the finder queries.

The case insensitive behaviour was already nicely tested in:

```ruby
def test_find_user_by_case_insensitive_username
%w{alice bob}.each do |name| User.create username: name end
assert_equal 'alice', User.find_by_username('ALICE').username
end

def test_find_a_bunch_of_users_by_case_insensitive_username
%w{alice bob fred}.each do |name| User.create username: name end
assert_equal ['alice', 'bob'], User.find_in_usernames(['ALICE', 'BOB']).map(&:username)
end
```

And those tests continue to pass with this change.