fixes #2741 - rails 3 syntax
fixes #2801 - remove LOWER() from default_scope that could cause Postgres error