aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Reduce allocations when running AR callbacks."Guo Xiang Tan2015-03-221-2/+2
| | | | This reverts commit 796cab45561fce268aa74e6587cdb9cae3bb243e.
* Delegate limit to subtypewallerjake2015-03-211-1/+1
| | | | | | | | | | As described here https://github.com/rails/rails/issues/19420. When using the Postgres BigInt[] field type the big int value was not being translated into schema.rb. This caused the field to become just a regular integer field when building off of schema.rb. This fix will address this by delegating the limit from the subtype to the Array type. https://github.com/rails/rails/issues/19420
* Don't cast nil to string in pg enumsSean Griffin2015-03-191-1/+3
| | | | Fixes #19389.
* Updated MySQL documentation link to MySQL latest version 5.6 everywhere [ci ↵amitkumarsuroliya2015-03-192-4/+4
| | | | skip]
* Updated MySQL documentation link to latest version MySQL 5.6 [ci skip]amitkumarsuroliya2015-03-191-2/+2
|
* Updated MySQL documentation link for STRICT_ALL_TABLESamitkumarsuroliya2015-03-191-1/+1
|
* Materialize subqueries by adding `DISTINCT`Yasuo Honda2015-03-161-1/+3
| | | | to support MySQL 5.7.6 `optimizer_switch='derived_merge=on'`
* Fix before_commit when updating a record on the callbackArthur Neves2015-03-141-23/+22
|
* Require pg~>0.18 to ensure Ruby 2.2 compatibilityMatt Brictson2015-03-111-2/+2
| | | | | | | Versions of the pg gem earlier than 0.18.0 cannot be used safely with Ruby 2.2. Specifically, pg 0.17 when used with Ruby 2.2 has a known bug that causes random bits to be added to the end of strings. Further explanation here: https://bitbucket.org/ged/ruby-pg/issue/210/crazy-bytes-being-added-to-record
* pg, `disable_referential_integrity` only catches AR errors.Yves Senn2015-03-111-2/+2
| | | | This change was prompted by 598b841.
* fix typo in transaction argument. Closes #19265.Yves Senn2015-03-111-1/+1
| | | | | | There was a typo in the `:requires_new` option. This led to `#<ArgumentError: unknown keyword: require_new>` leaving all the triggers in a disabled state.
* Correctly dump `serial` and `bigserial`Ryuta Kamizono2015-03-044-4/+29
|
* Add `Column#bigint?` methodRyuta Kamizono2015-03-043-3/+7
|
* Merge pull request #19171 from JuanitoFatas/doc/more-examplesSean Griffin2015-03-021-0/+16
|\ | | | | Add more documents for AR connection_adapters abstract schema_definitions. [ci skip]
| * Add more documents for AR connection_adapters abstract schema_definitions. ↵Juanito Fatas2015-03-031-0/+16
| | | | | | | | | | | | | | | | | | [ci skip] - Add example to column_exists? - Add example to index_exists? - Add document for foreign_key - Add document for foreign_key_exists?
* | Revert "delete unused method"Carlos Antonio da Silva2015-03-021-0/+4
| | | | | | | | | | | | | | | | This reverts commit a38732c8e6ab76ea0db4e1a617a1fa84b53a9750. Since the mutation logic was reverted in 07278519bb6db5579171fea70bccdfee1306f1d4, we must bring the reader method back as well, since the implementation relies on it.
* | Revert "mutate the transaction object to reflect state"Aaron Patterson2015-03-021-29/+25
| | | | | | | | | | | | | | | | This reverts commit 393e65b4170608593ad82377a9eadc918e85698d and ec51c3fedd16b561d096dcc1a6705fdc02ab7666 We don't want the records to hold hard references to transactions because they point at records that have callbacks.
* | delete unused methodAaron Patterson2015-03-021-4/+0
| |
* | mutate the transaction object to reflect stateAaron Patterson2015-03-021-25/+21
| | | | | | | | | | this lets us keep singleton instances of "state" values and precalculate return values of things like `finalized?` and `completed?`.
* | ask the txn for it's state, not a state objectAaron Patterson2015-03-021-0/+8
| | | | | | | | | | this way we don't have to mutate a state object, we can just change the state of the txn
* | change if! to unlessAaron Patterson2015-03-021-1/+1
| |
* | Merge pull request #19172 from JuanitoFatas/doc/fix-typoRichard Schneeman2015-03-021-2/+2
|\ \ | | | | | | [ci skip] Fix a typo for PostgreSQL text limit, GB instead of Gb.
| * | [ci skip] Fix a typo for PostgreSQL text limit, GB instead of Gb.Juanito Fatas2015-03-031-2/+2
| |/
* / Clarify that t.references and t.belongs_to are interchangeable. [ci skip]Juanito Fatas2015-03-021-1/+1
|/
* Remove parent transaction stateArthur Neves2015-03-011-3/+0
| | | | As far as I can tell nobody is setting this variable.
* Add `SchemaMigration.create_table` support any unicode charsets for MySQL.Ryuta Kamizono2015-02-262-9/+10
| | | | | | | | | | | | | | | | | MySQL unicode support is not only `utf8mb4`. Then, The index length problem is not only `utf8mb4`. http://dev.mysql.com/doc/refman/5.6/en/charset-unicode.html SELECT * FROM information_schema.character_sets WHERE maxlen > 3; +--------------------+----------------------+------------------+--------+ | CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN | +--------------------+----------------------+------------------+--------+ | utf8mb4 | utf8mb4_general_ci | UTF-8 Unicode | 4 | | utf16 | utf16_general_ci | UTF-16 Unicode | 4 | | utf16le | utf16le_general_ci | UTF-16LE Unicode | 4 | | utf32 | utf32_general_ci | UTF-32 Unicode | 4 | +--------------------+----------------------+------------------+--------+
* cache quoted column names in SQLite3Aaron Patterson2015-02-241-1/+2
| | | | we do this in other adapters, and it's a nice speed improvement
* Merge pull request #19068 from pda/ar-translate-exception-class-no-logAaron Patterson2015-02-241-1/+0
|\ | | | | AR: translate_exception_class() no longer logs error.
| * AR: translate_exception_class() no longer logs error.Paul Annesley2015-02-241-1/+0
| |
* | Merge pull request #18936 from arthurnn/txn_callbacksArthur Nogueira Neves2015-02-241-1/+7
|\ \ | |/ |/| Spike on new transaction callbacks
| * Add before_commitArthur Neves2015-02-241-1/+7
| | | | | | | | [fixes #18903]
* | Tiny documentation edits [ci skip]Robin Dupret2015-02-241-1/+1
| |
* | Fix mysql's schema.rb dumper so it does not include limit on emulated ↵Court3nay2015-02-241-0/+1
| | | | | | | | boolean tinyint(1) fields
* | rework `disable_referential_integrity` for PostgreSQL.Yves Senn2015-02-241-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Toby Ovod-Everett & Andrey Nering & Yves Senn] Closes #17726. Closes #10939. This patch makes three distinct modifications: 1. no longer fall back to disabling user triggers if system triggers can't be disabled 2. warn the user when referential integrity can't be disabled 3. restore aborted transactions when referential integrity can't be disabled The motivation behind these changes is to make the behavior of Rails transparent and less error-prone. To require superuser privileges is not optimal but it's what Rails currently needs. Users who absolutely rely on disabling user triggers can patch `disable_referential_integrity`. We should investigate `SET CONSTRAINTS` as a possible solution which does not require superuser privileges. /cc @matthewd
* | Move back `new_column_definition` into `TableDefinition`Ryuta Kamizono2015-02-251-4/+4
| | | | | | | | | | | | | | | | | | Only `primary_key` should be extracted by d47357e in #19030, but `new_coclumn_definition` was also extracted because #17631 is merged previously, then #19030 is auto merged without conflicts. This commit is for move back `new_column_definition` into `TableDefinition`.
* | Merge pull request #19030 from kamipo/extract_short_hand_column_methodsRafael Mendonça França2015-02-233-109/+139
|\ \ | | | | | | Extract the short-hand column methods into `ColumnMethods`
| * | The short-hand methods should be able to define multiple columnsRyuta Kamizono2015-02-231-44/+50
| | |
| * | Extract the short-hand methods into `ColumnMethods`Ryuta Kamizono2015-02-231-23/+28
| | |
| * | Extract `primary_key` method into `ColumnMethods`Ryuta Kamizono2015-02-223-42/+61
| | |
* | | Allow `:limit` option for MySQL bigint primary key supportRyuta Kamizono2015-02-241-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Example: create_table :foos, id: :primary_key, limit: 8 do |t| end # or create_table :foos, id: false do |t| t.column :id, limit: 8 end
* | Format the time string according to the precision of the time columnRyuta Kamizono2015-02-201-2/+2
| | | | | | | | It is also necessary to format a time column like a datetime column.
* | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-205-13/+19
| |
* | Merge pull request #18916 from kamipo/handle_array_option_in_type_to_sqlRafael Mendonça França2015-02-192-37/+25
|\ \ | | | | | | Handle array option in `type_to_sql`
| * | Handle array option in `type_to_sql`Ryuta Kamizono2015-02-191-19/+16
| | | | | | | | | | | | | | | `[]` is a part of `sql_type`, so it is always necessary to respect to array option when `type_to_sql` is called.
| * | Use `delegate` to call the methods to `@conn`Ryuta Kamizono2015-02-191-16/+3
| | |
| * | Should handle array option for `:cast_as`Ryuta Kamizono2015-02-191-4/+8
| | |
* | | Extract precision from datetime and time columnsRyuta Kamizono2015-02-192-7/+4
|/ / | | | | | | | | | | | | | | The cause by which the test suite for the mysql adapter broke in 1502cae (reverted 89ba5bb) is because the precision was not extracted. The rounding problem in mysql adapter has not been fixed, but `mysql_56` helper tested only mysql2 adapter, its behavior was not apparent.
* | Rm `Type#type_cast`Sean Griffin2015-02-176-8/+8
| | | | | | | | | | | | | | | | | | This helper no longer makes sense as a separate method. Instead I'll just have `deserialize` call `cast` by default. This led to a random infinite loop in the `JSON` pg type, when it called `super` from `deserialize`. Not really a great way to fix that other than not calling super, or continuing to have the separate method, which makes the public API differ from what we say it is.
* | `type_cast_from_user` -> `cast`Sean Griffin2015-02-171-2/+2
| |
* | `type_cast_for_database` -> `serialize`Sean Griffin2015-02-1712-15/+15
| |