Cast number to string in Postgres

fixes #9170
Small typos here and there.
Merge pull request #9686 from strzalek/cast_number_to_string_in_pg

Cast number to string in Postgres
Merge pull request #9728 from vipulnsward/fix_em_typos

Small typos here and there.
rename `Relation#uniq` to `Relation#distinct`. `#uniq` still works.

The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our
Relation API is close to SQL terms I renamed `#uniq` to `#distinct`.

There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue
to work. I also updated the documentation to promote the use of `#distinct`.
Deprecate the `:distinct` option for `Relation#count`.

We moved more and more away from passing options to finder / calculation
methods. The `:distinct` option in `#count` was one of the remaining places.
Since we can now combine `Relation#distinct` with `Relation#count` the option
is no longer necessary and can be deprecated.
Merge pull request #9683 from senny/deprecate_count_distinct_option

rename `Relation#uniq` to `Relation#distinct`
Cache the association proxy object

This reimplements the behaviour of Rails 3, as I couldn't see why we
shouldn't cache the object, and @alindeman had a good use case for
caching it:

https://github.com/rails/rails/commit/c86a32d7451c5d901620ac58630460915292f88b#commitcomment-2784312
make it possible to disable implicit join references.

Closes #9712.
Merge pull request #9733 from senny/9712_option_to_turn_references_deprecation_off

make it possible to disable implicit join references.