rails/rails — pull request #12176 by arthurnn (2013-09-09 18:00:25+00:00)
Title: on SchemaCache use the connection getter instead of the obj given

Hash `default_proc` needs to use the connection getter to avoid inconsistent results if the connection ivar is changed.

Ideally `@connection` cannot be changed on schema_cache as it doesnt have a setter, but we still can `instance_variable_set(:@connection, conn)`. Therefore we need to use the getter on the proc so it will always use the ivar.

As this is super small, and trivial, IMO, it doesn't justify adding tests for it. (also this behaviour is fixed on rails4)

feedback ? @carlosantoniodasilva @rafaelfranca