aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Use a type object for type casting behavior on SQLite3Sean Griffin2014-07-011-13/+37
| | |/ | |/| | | | | | | | | | Note: I'm not sure we actually need to be logging when this happens. This code would be a fair bit cleaner if we didn't need to log it.
* | | Merge pull request #16037 from sgrif/sg-money-quotingRafael Mendonça França2014-07-041-7/+0
|\ \ \ | |_|/ |/| | Remove unneccessary special case for money in quoting
| * | Remove unneccessary special case for money in quotingSean Griffin2014-07-031-7/+0
| | |
* | | Merge pull request #16036 from sgrif/sg-datetime-infinityRafael Mendonça França2014-07-032-3/+2
|\ \ \ | | | | | | | | Do not rely on the column type when quoting infinity
| * | | Do not rely on the column type when quoting infinitySean Griffin2014-07-032-3/+2
| |/ /
* / / Use the type object for type casting HStore columnsSean Griffin2014-07-033-55/+34
|/ /
* | Quote range strings when quoting PG rangesSean Griffin2014-07-021-1/+1
| | | | | | | | | | The test case for CVE-2014-3483 doesn't actually send the generated SQL to the database. The generated SQL is actually invalid for real inputs.
* | Fix SQL injection when querying against ranges and bitstringsRafael Mendonça França2014-07-022-4/+5
|/ | | | Fix CVE-2014-3483 and protect against CVE-2014-3482.
* Merge pull request #15977 from sgrif/sg-remove-array-hackGodfrey Chan2014-06-291-24/+0
|\ | | | | Remove array workaround in PG quoting
| * Remove array workaround in PG quotingSean Griffin2014-06-291-24/+0
| | | | | | | | | | We no longer need to do fancy legwork to make sure arrays use a type object, now that schema methods use a real type object.
* | Remove unused `array_member` from PG quoting for HStore columnsSean Griffin2014-06-292-12/+9
|/ | | | | Hstore no longer needs additional quoting to be used in an array, the array type handles it sufficiently.
* 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.