Fix some typos
Stub logger for tests
ActiveRecord::Relation#blank? should `LIMIT 1`

This is an SQL improvement to ActiveRecord::Relation#blank?. Currently,
it calls `to_a` on the Relation, which loads all records in the
association, and calls `blank?` on the loaded Array. There are other
ways, however, to check the emptiness of an association that are far
more performant. `#empty?`, `#exists?` and `#any?` all attach a `LIMIT
1` to the SQL query before firing it off, which is a nice query
improvement. `#blank?` should do the same!

Bonus performance improvements will also happen for `#present?`, which
merely calls the negation of `#blank?`

Signed-off-by: David Celis <me@davidcel.is>
Revert "Merge pull request #10539 from davidcelis/ar-sql-improvements"

This reverts commit 257fa6897d9c85da16b7c9fcb4ae3008198d320e, reversing
changes made to 94725b81f5588e4b0f43222c4f142c3135941b4b.

The build failed

https://travis-ci.org/rails/rails/builds/7883546
Handle single quotes in PostgreSQL default column values

PostgreSQL escapes single quotes by using an additional single quote.
When Rails queries the column information, PostgreSQL returns the
default values with the escaped single quotes.

#extract_value_from_default now converts these to one single quote each.

Fixes #10881.