aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
Commit message (Collapse)AuthorAgeFilesLines
* Use the type object when sending point columns to the DBSean Griffin2014-06-293-19/+9
|
* Use the type object for sending JSON to the databaseSean Griffin2014-06-293-22/+10
|
* Always pass a column with a type object to quoteSean Griffin2014-06-286-15/+23
| | | | | | | | The only case where we got a column that was not `nil`, but did not respond to `cast_type` was when type casting the default value during schema creation. We can look up the cast type, and add that object to the column definition. Will allow us to consistently rely on the type objects for type casting in all directions.
* rename sequence only if it existsAbdelkader Boudih2014-06-271-3/+3
|
* Change method visibilityRafael Mendonça França2014-06-261-2/+2
|
* Add nodoc to internal class [ci skip]Rafael Mendonça França2014-06-261-1/+1
|
* fk: add docsYves Senn2014-06-261-0/+58
|
* fk: review corrections: indent, visibility, syntax, wording.Yves Senn2014-06-264-49/+50
|
* fk: use random digest namesYves Senn2014-06-263-10/+23
| | | | | | The name of the foreign key is not relevant from a users perspective. Using random names resolves the urge to rename the foreign key when the respective table or column is renamed.
* fk: raise for invalid :on_update / :on_delete valuesYves Senn2014-06-261-3/+8
|
* fk: `add/remove_foreign_key` are noop for adapters that don't support fkYves Senn2014-06-261-0/+4
|
* fk: raise when identifiers are longer than `allowed_index_name_length`.Yves Senn2014-06-261-1/+5
|
* fk: support for on_updateYves Senn2014-06-265-16/+32
|
* fk: rename `dependent` to `on_delete`Yves Senn2014-06-265-13/+12
|
* fk: infere column name from table names.Yves Senn2014-06-261-4/+14
| | | | This allows to create and remove foreign keys without specifying a column.
* fk: support dependent option (:delete, :nullify and :restrict).Yves Senn2014-06-265-4/+39
|
* fk: `:primary_key` option for non-standard pk's.Yves Senn2014-06-261-1/+3
|
* fk: generalize using `AlterTable` and `SchemaCreation`.Yves Senn2014-06-265-47/+60
|
* fk: `foreign_keys`, `add_foreign_key` and `remove_foreign_key` for MySQLYves Senn2014-06-265-21/+65
|
* fk: add `foreign_keys` for PostgreSQL adapter.Yves Senn2014-06-262-0/+38
|
* fk: `add_foreign_key` and `remove_foreign_key` for PostgreSQL adapter.Yves Senn2014-06-263-0/+36
|
* Move writing unknown column exception to null attributeSean Griffin2014-06-261-1/+1
| | | | | | Making this change revealed several subtle bugs related to models with no primary key, and anonymous classes. These have been fixed as well, with regression tests added.
* Merge pull request #15847 from sgrif/sg-encapsulate-result-typesRafael Mendonça França2014-06-261-3/+2
|\ | | | | Encapsulate knowledge of type objects on `ActiveRecord::Result`
| * Encapsulate knowledge of type objects on `ActiveRecord::Result`Sean Griffin2014-06-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Attempting to reduce the number of places that care about the details of how type casting occurs. We remove the type casting of the primary key in `JoinDependecy`, rather than encapsulating it. It was originally added for consistency with https://github.com/rails/rails/commit/40898c8c19fa04442fc5f8fb5daf3a8bdb9a1e03#diff-06059df8d3dee3101718fb2c01151ad0R211, but that conditional was later removed in https://github.com/rails/rails/commit/d7ddaa530fd1b94e22d745cbaf2e8a5a34ee9734. What is important is that the same row twice will have the same value for the primary key, which it will.
* | add missing `:nodoc:` for recent refactorings. [ci skip]Yves Senn2014-06-2424-25/+25
| | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #15881 from mmozuras/remove_unused_paramsRafael Mendonça França2014-06-231-3/+3
|\ \ | | | | | | Remove unused params
| * | Remove unused param 'conn' from ConnectionPool#releaseMindaugas Mozūras2014-06-231-3/+3
| |/
* / Add a deprecation cycle for `NullColumn` from `column_for_attribute`Sean Griffin2014-06-231-6/+0
|/ | | | | | This is public API, and `simple_form` depends on the `nil` return value. We need to go through a deprecation cycle to return a null object. If people want hash access, they can access the hash.
* Merge pull request #15802 from sgrif/sg-column-quotingRafael Mendonça França2014-06-192-6/+6
|\ | | | | Don't use column object for type casting in `quoting`
| * Don't use column object for type casting in `quoting`Sean Griffin2014-06-182-6/+6
| | | | | | | | | | | | | | | | | | We're never going to be able to use the attribute object here, however, so let's just accept the ugly demeter violation here for now. Remove test cases which were either redundant with other tests in the file, or were actually testing the type objects (which are tested elsewhere)
* | this method is no longer being usedJosh Sharpe2014-06-191-4/+0
|/
* Merge pull request #15782 from sgrif/sg-column-defaultsMatthew Draper2014-06-183-15/+19
|\ | | | | Don't type cast the default on the column
| * Don't type cast the default on the columnSean Griffin2014-06-173-15/+19
| | | | | | | | | | | | | | If we want to have type decorators mess with the attribute, but not the column, we need to stop type casting on the column. Where possible, we changed the tests to test the value of `column_defaults`, which is public API. `Column#default` is not.
* | Detect in-place changes on point typesSean Griffin2014-06-172-3/+20
| |
* | 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)
* | Merge pull request #15778 from sgrif/sg-pg-mutable-arraysMatthew Draper2014-06-183-38/+52
|\ \ | |/ |/| Move pg array database type casting to the Array type
| * Move array database type casting to the Array typeSean Griffin2014-06-173-38/+52
| | | | | | | | | | | | | | | | | | 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.
* | Don't assume that Hstore columns have always changedSean Griffin2014-06-171-1/+1
|/ | | | | | | | | HStore columns come back from the database separated by a comma and a space, not just a comma. We need to mirror that behavior since we compare the two values. Also adds a regression test against JSON to ensure we don't have the same bug there.
* /mysql/i -> MySQL, Spell correct in continuation to #15555Akshay Vishnoi2014-06-144-7/+7
|
* Parsing DATABASE_URI, use URI#hostname: it's smarter about IPv6Matthew Draper2014-06-141-1/+1
| | | | Fixes #15705.
* Remove `serialized?` from the type interfaceSean Griffin2014-06-131-1/+1
|
* 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.
* | Remove unused requireSean Griffin2014-06-111-2/+0
|/ | | | We're not longer using `ipaddr` in schema dumper
* Remove YAML serialization workaround for columnsSean Griffin2014-06-111-6/+2
| | | | | We are no longer including column objects in YAML serialization, thanks to https://github.com/rails/rails/pull/15621
* Keep the types of virtual columns after yaml serializationSean Griffin2014-06-101-2/+6
| | | | | On MySQL and PostgreSQL, the adapter does not type cast virtual columns for us.