1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases
Arturo Pie 2da85edda3 #7914 get default value when type uses schema name
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.
2012-10-13 19:41:50 -04:00
..
adapters #7914 get default value when type uses schema name 2012-10-13 19:41:50 -04:00
associations
attribute_methods
coders
connection_adapters
connection_specification
fixture_set
migration
relation
tasks
validations
adapter_test.rb
aggregations_test.rb
ar_schema_test.rb
associations_test.rb
attribute_methods_test.rb Revert "Key the attributes hash with symbols" 2012-10-12 11:49:13 +01:00
autosave_association_test.rb
base_test.rb
batches_test.rb
binary_test.rb
bind_parameter_test.rb
calculations_test.rb
callbacks_test.rb
clone_test.rb
column_alias_test.rb
column_definition_test.rb
column_test.rb
connection_management_test.rb
connection_pool_test.rb
counter_cache_test.rb
custom_locking_test.rb
database_statements_test.rb
date_time_test.rb
defaults_test.rb #7914 get default value when type uses schema name 2012-10-13 19:41:50 -04:00
deprecated_dynamic_methods_test.rb
dirty_test.rb
dup_test.rb
explain_subscriber_test.rb
explain_test.rb
finder_respond_to_test.rb
finder_test.rb
fixtures_test.rb
forbidden_attributes_protection_test.rb
habtm_destroy_order_test.rb
helper.rb
hot_compatibility_test.rb
i18n_test.rb
inclusion_test.rb
inheritance_test.rb
invalid_date_test.rb
invertible_migration_test.rb
json_serialization_test.rb
lifecycle_test.rb
locking_test.rb
log_subscriber_test.rb
migration_test.rb
migrator_test.rb
mixin_test.rb
modules_test.rb
multiparameter_attributes_test.rb
multiple_db_test.rb
named_scope_test.rb
nested_attributes_test.rb
persistence_test.rb
pooled_connections_test.rb
primary_keys_test.rb
query_cache_test.rb
quoting_test.rb
readonly_test.rb
reaper_test.rb
reflection_test.rb
relation_scoping_test.rb
relation_test.rb
relations_test.rb learn ActiveRecord::QueryMethods#order work with hash arguments 2012-10-12 17:57:24 +03:00
reload_models_test.rb
sanitize_test.rb
schema_dumper_test.rb
serialization_test.rb
serialized_attribute_test.rb
store_test.rb
test_case.rb
timestamp_test.rb
transaction_callbacks_test.rb
transaction_isolation_test.rb
transactions_test.rb
unconnected_test.rb
validations_repair_helper.rb
validations_test.rb
xml_serialization_test.rb
yaml_serialization_test.rb