aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid
Commit message (Collapse)AuthorAgeFilesLines
...
| * Don't rely on the sql type to quote XML columns in PGSean Griffin2014-07-061-0/+32
| |
* | Remove the `text?` predicate from the type objectsSean Griffin2014-07-061-4/+0
|/ | | | | | | This was only used for uniqueness validations. The first usage was in conjunction with `limit`. Types which cast to string, but are not considered text cannot have a limit. The second case was only with an explicit `:case_sensitive => true` option given by the user.
* Use the type object for quoting PG RangesSean Griffin2014-07-051-18/+34
|
* Merge pull request #16036 from sgrif/sg-datetime-infinityRafael Mendonça França2014-07-031-0/+1
|\ | | | | Do not rely on the column type when quoting infinity
| * Do not rely on the column type when quoting infinitySean Griffin2014-07-031-0/+1
| |
* | Use the type object for type casting HStore columnsSean Griffin2014-07-031-2/+34
|/
* Use the type object when sending point columns to the DBSean Griffin2014-06-291-1/+7
|
* Use the type object for sending JSON to the databaseSean Griffin2014-06-291-2/+10
|
* add missing `:nodoc:` for recent refactorings. [ci skip]Yves Senn2014-06-2422-22/+22
| | | | | | | | | | Adding `# :nodoc:` to the parent `class` / `module` is not going to ignore nested classes or modules. There is a modifier `# :nodoc: all` but sadly the containing class or module will continue to be in the docs. /cc @sgrif
* Detect in-place changes on point typesSean Griffin2014-06-171-2/+15
|
* Detect mutations of arrays and array membersSean Griffin2014-06-171-12/+14
|
* Ensure `OID::Array#type_cast_for_database` matches PG's quoting behaviorSean Griffin2014-06-172-7/+21
| | | | | | Also takes a step towards supporting types which use a character other than ',' for the delimiter (`box` is the only built in type for which this is the case)
* Move array database type casting to the Array typeSean Griffin2014-06-171-0/+30
| | | | | | | | | The case where we have a column object, but don't have a type cast method involves type casting the default value when changing the schema. We get one of the column definition structs instead. That is a case that I'm trying to remove overall, but in the short term, we can achieve the same behavior without needing to pass the adapter to the array type by creating a fake type that proxies to the adapter.
* Merge pull request #15674 from sgrif/sg-mutable-attributesMatthew Draper2014-06-142-8/+4
|\ | | | | Detect in-place changes on mutable AR attributes
| * Detect in-place changes on mutable AR attributesSean Griffin2014-06-132-8/+4
| | | | | | | | | | | | We have several mutable types on Active Record now. (Serialized, JSON, HStore). We need to be able to detect if these have been modified in place.
* | Merge pull request #15593 from sgrif/sg-attributeRafael Mendonça França2014-06-131-2/+3
|\ \ | | | | | | Introduce an Attribute object to handle the type casting dance
| * | Introduce an Attribute object to handle the type casting danceSean Griffin2014-06-131-2/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a lot more that can be moved to these, but this felt like a good place to introduce the object. Plans are: - Remove all knowledge of type casting from the columns, beyond a reference to the cast_type - Move type_cast_for_database to these objects - Potentially make them mutable, introduce a state machine, and have dirty checking handled here as well - Move `attribute`, `decorate_attribute`, and anything else that modifies types to mess with this object, not the columns hash - Introduce a collection object to manage these, reduce allocations, and not require serializing the types
* / PG arrays should type cast user inputSean Griffin2014-06-131-4/+8
|/ | | | | | We guarantee that `model.value` does not change after `model.save && model.reload`. This requires type casting user input for non-string types.
* Inline PG array type casting helperSean Griffin2014-06-101-4/+26
|
* Rename `type_cast` to `type_cast_from_database`Sean Griffin2014-06-093-11/+11
| | | | | | | | In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally.
* Make `_before_type_cast` actually be before type castSean Griffin2014-06-092-2/+10
| | | | | | | | | | | | | - The following is now true for all types, all the time - `model.attribute_before_type_cast == given_value` - `model.attribute == model.save_and_reload.attribute` - `model.attribute == model.dup.attribute` - `model.attribute == YAML.load(YAML.dump(model)).attribute` - Removes the remaining types implementing `type_cast_for_write` - Simplifies the implementation of time zone aware attributes - Brings tz aware attributes closer to being implemented as an attribute decorator - Adds additional point of control for custom types
* Don't mess with `_before_type_cast` for numeric typesSean Griffin2014-06-061-2/+1
|
* Merge pull request #15503 from sgrif/sg-json-hstore-storageYves Senn2014-06-062-12/+0
|\ | | | | Bring type casting behavior of hstore/json in line with serialized
| * Bring type casting behavior of hstore/json in line with serializedSean Griffin2014-06-042-12/+0
| | | | | | | | | | `@raw_attributes` should not contain the type-cast, mutable version of the value.
* | Fix behavior of handling BC era dates.edogawaconan2014-06-051-1/+2
|/ | | | BC era year is (astronomical year + 1) and starts from 1 BC.
* pg, preserve money type when dumping schema and extract money default.Yves Senn2014-06-031-0/+4
|
* pg, preserve type when schema dumping bit and bit varying columns.Yves Senn2014-06-032-1/+18
|
* pg, preserve point type when schema dumping.Yves Senn2014-06-031-1/+5
|
* pg, inline casting methods into `OID::Type` objects.Yves Senn2014-06-022-2/+25
| | | | | | | | This inlines casting for the most obvious types. The rest will follow eventually. I need to put some tests in place, to make sure that the inlining is not causing regressions. /cc @sgrif
* refactor, introduce `Type#type_cast_for_schema` to cast for schema.rbYves Senn2014-05-302-0/+15
| | | | | | | This removes the case statement in `SchemaDumper` and gives every `Type` the possibility to control the SchemaDumper default value output. /cc @sgrif
* pg, keep `hstore` and `json` attributes as `Hash` in @attributes.Yves Senn2014-05-282-2/+14
| | | | | | | | | | | The solution presented in this patch is not efficient. We should replace it in the near future. The following needs to be worked out: * Is `@attributes` storing the Ruby or SQL representation? * `cacheable_column?` is broken but `hstore` and `json` rely on that behavior Refs #15369. /cc @sgrif @rafaelfranca
* Inline type cast method for PG pointsSean Griffin2014-05-231-1/+4
|
* Push scale to type objectsSean Griffin2014-05-221-1/+1
| | | | | | Ideally types will be usable without having to specify a sql type string, so we should keep the information related to parsing them on the adapter or another object.
* Move `extract_precision` onto type objectsDan Croak and Sean Griffin2014-05-221-0/+2
|
* Use the generic type map for all PG type registrationsSean Griffin2014-05-221-6/+13
| | | | | | | 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
* Move PG OID types to their own filesSean Griffin2014-05-2122-0/+507
As we promote these classes to first class concepts, these classes are starting to gain enough behavior to warrant being moved into their own files. Many of them will become quite large as we move additional behavior to the type objects.