aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/composite_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* test pg, rm unused requires.Yves Senn2014-06-031-2/+0
|
* Remove most code related to serialized propertiesSean Griffin2014-06-011-0/+1
| | | | | | | | | | | Nearly completely implemented in terms of custom properties. `_before_type_cast` now stores the raw serialized string consistently, which removes the need to keep track of "state". The following is now consistently true: - `model.serialized == model.reload.serialized` - A model can be dumped and loaded infinitely without changing - A model can be saved and reloaded infinitely without changing
* Move types to the top level `ActiveRecord` namespaceSean Griffin2014-05-271-1/+1
| | | | | `ActiveRecord::ConnectionAdapters::Type::Value` => `ActiveRecord::Type::Value`
* Add an interface for type objects to control Ruby => SQLSean Griffin2014-05-261-1/+0
| | | | | Adds the ability to save custom types, which type cast to non-primitive ruby objects.
* Use the generic type map for all PG type registrationsSean Griffin2014-05-221-9/+1
| | | | | | | We're going to want all of the benefits of the type map object for registrations, including block registration and real aliasing. Moves type name registrations to the adapter, and aliases the OIDs to the named types
* Delegate predicate methods to injected type object on ColumnSean Griffin2014-05-201-1/+1
|
* Delegate `Column#type` to the injected type objectSean Griffin2014-05-191-1/+0
| | | | | | | | | | | | | | | | The decision to wrap type registrations in a proc was made for two reasons. 1. Some cases need to make an additional decision based on the type (e.g. a `Decimal` with a 0 scale) 2. Aliased types are automatically updated if they type they point to is updated later. If a user or another adapter decides to change the object used for `decimal` columns, `numeric`, and `number` will automatically point to the new type, without having to track what types are aliased explicitly. Everything else here should be pretty straightforward. PostgreSQL ranges had to change slightly, since the `simplified_type` method is gone.
* pg, clarify default behavior for composite types.Yves Senn2014-05-131-7/+94
| | | | | | | | | | | | * by default composite types are mapped as `OID::Identity` and issue a warning * the user is advised to register his own `OID::Type` to make use of composite types Registering a new `OID::Type` does currently not allow to specify the type casting behavior when writing to the database. In order for it to work we need to use the values within `@attributes`. They are already being type casted and are ready to be written to the DB. See https://github.com/rails/rails/blob/57643c961feb24b662620d330e71103a830003e8/activerecord/lib/active_record/attribute_methods.rb#L460-L462
* PostgreSQL, test cases to lock the current column types.Yves Senn2014-03-281-0/+11
|
* Use teardown helper method.Guo Xiang Tan2014-03-141-1/+1
| | | | | | | | Follow-Up to https://github.com/rails/rails/pull/14348 Ensure that SQLCounter.clear_log is called after each test. This is a step to prevent side effects when running tests. This will allow us to run them in random order.
* test case to illustrate current PostgreSQL composite behavior.Yves Senn2014-02-111-0/+42