Changes: * According to postgreSQL documentation: (http://www.postgresql.org/docs/8.2/static/catalog-pg-attrdef.html) we should not be using 'adsrc' field because this field is unaware of outside changes that could affect the way that default values are represented. Thus, I changed the queries to use "pg_get_expr(adbin, adrelid)" instead of the historical "adsrc" field. * Remove parsing of character type default values for 8.1 formatting since Rails doesn't support postgreSQL 8.1 anymore. * Remove misleading comment unrelated to code.
PostgreSQL adapter properly parses default values when using multiple schemas and domains. When using domains across schemas, PostgresSQL prefixes the type of the default value with the name of the schema where that type (or domain) is. For example, this query: ``` SELECT a.attname, d.adsrc FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = "defaults"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum; ``` could return something like "'<default_value>'::pg_catalog.text" or "(''<default_value>'::pg_catalog.text)::text" for the text columns with defaults. I modified the regexp used to parse this value so that it ignores anything between ':: and \b(?:character varying|bpchar|text), and it allows to have optional parens like in the above second example.
If you create a new record via a collection association proxy that has not loaded its target, and which selects additional attributes through the association, then when the proxy loads its target, it will inadvertently trigger a deprecation notice during attribute writing when CollectionAssociation#merge_target_lists attempts to do its thing, since the newly loaded records will possess attributes the created record does not.
This reverts commit 0693e07. Revert "Cache columns metadata to avoid extra while testing" This reverts commit a82f1e3. Reason: This is causing failures in the postgresql build. See http://travis-ci.org/#!/rails/rails/builds/2485584 Related with #7675
6d5f4de Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests. 4b1bca0 Stop being silly with formatting of method aliasing. c381d5c Fix just-plain-wrongness of psql auto-reconnect test. 1e17a9d Fix only-once stub logic. f16c2043826ec1991cf94fe17cb671507b7a7f51 Changelog for PostgreSQL auto-reconnect test coverage backport.
…ase configuration use not charset but encoding.
…s to integer calling #to_i
I had to create a new table because I needed an STI table, which does not have both a "type" and a "custom_type" the test fails with: 1) Error: test_alt_becomes_works_with_sti(InheritanceTest): NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber"> /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rbin `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes' test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti' test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti' Conflicts: activerecord/test/cases/inheritance_test.rb
…iation conditions Conflicts: activerecord/test/models/reader.rb