Cast number to string in Postgres

fixes #9170
UTF-8 encode all keys and values in nested params hash.
Small typos here and there.
Warning removed unused variable task_name

warning: assigned but unused variable - task_name
Merge pull request #9732 from arunagw/warning_fix_unused_variable

Warning removed unused variable task_name
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
Refactored to reuse method
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.
config.ru uses the effective Rack app

We used to pass the Rails::Application subclass to #run.
The Rails server then called #to_app to convert that class to the
actual Rack application.

if you surround `#run` with a call to `#map` the server no longer
convertes the class to the instance and we end up with unnecessary
delegation calls on every request.
make new rails apps log to STDOUT
Merge pull request #9691 from hone/stdout_logging

Rails default logging to STDOUT
Fix implicit join references option reversion in test
Merge pull request #5606 from teohm/multipart_unicode_param_name

multipart POST - utf8 param name not encoded
Revert "make new rails apps log to STDOUT"

This reverts commit b7d9d6e2cd5082d269dafbc0316e2107febe1451.

Per discussion with @jeremy and @rubys on Campfire.