aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract
Commit message (Collapse)AuthorAgeFilesLines
* Document that partial indexes are only supported by Postgres and SQLite.Grey Baker2015-04-131-0/+2
| | | | Fixes #18106
* Add a note regarding add_column restricted API [ci skip]Zachary Scott2015-04-121-0/+4
| | | | | | We should document current behavior, and this is design of API for now. Closes #17597
* fix documentation for SchemaStatements#add_foreign_keySimon Stemplinger2015-04-081-2/+2
| | | | | | The implementation of the generation of the foreign key name was changed between Rails 4.2.0 and 4.2.1 from a random to a deterministic behavior, however the documentation still describes the old randomized behavior.
* Merge pull request #19448 from tgxworld/fix_activesupport_callbacks_clash_on_runRafael Mendonça França2015-04-061-2/+2
|\ | | | | Fix AS::Callbacks raising an error when `:run` callback is defined.
| * Revert "Reduce allocations when running AR callbacks."Guo Xiang Tan2015-03-221-2/+2
| | | | | | | | This reverts commit 796cab45561fce268aa74e6587cdb9cae3bb243e.
* | No need to document drop_table in the PostgreSQLAdapterRafael Mendonça França2015-04-061-0/+3
| | | | | | | | | | | | It behaves in the same way that the abstract adapter. [ci skip]
* | use singular table name if pluralize_table_names is setted as false while ↵Mehmet Emin İNAÇ2015-04-062-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | creating foreign key test case for use singular table name if pluralize_table_names is setted as false while creating foreign key refactor references foreign key addition tests use singular table name while removing foreign key merge foreign key singular table name methods remove unnecessary drop table from test
* | Freeze static arguments for gsubbrainopia2015-04-021-1/+1
| |
* | Prefer string patterns for gsubbrainopia2015-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/ruby/ruby/pull/579 - there is a new optimization since ruby 2.2 Previously regexp patterns were faster (since a string was converted to regexp underneath anyway). But now string patterns are faster and better reflect the purpose. Benchmark.ips do |bm| bm.report('regexp') { 'this is ::a random string'.gsub(/::/, '/') } bm.report('string') { 'this is ::a random string'.gsub('::', '/') } bm.compare! end # string: 753724.4 i/s # regexp: 501443.1 i/s - 1.50x slower
* | [ci skip] Remove unacceptable method nameyui-knk2015-03-241-1/+1
|/
* Updated MySQL documentation link to MySQL latest version 5.6 everywhere [ci ↵amitkumarsuroliya2015-03-191-2/+2
| | | | skip]
* Fix before_commit when updating a record on the callbackArthur Neves2015-03-141-23/+22
|
* Correctly dump `serial` and `bigserial`Ryuta Kamizono2015-03-041-1/+5
|
* 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
| |
* | 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.
* 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
| |
* | Extract the short-hand methods into `ColumnMethods`Ryuta Kamizono2015-02-231-23/+28
| |
* | Extract `primary_key` method into `ColumnMethods`Ryuta Kamizono2015-02-221-6/+13
| |
* | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-201-0/+6
| |
* | Use `delegate` to call the methods to `@conn`Ryuta Kamizono2015-02-191-16/+3
| |
* | `type_cast_for_database` -> `serialize`Sean Griffin2015-02-171-2/+2
| |
* | `Type#type_cast_from_database` -> `Type#deserialize`Sean Griffin2015-02-171-1/+1
| |
* | Revert "Allow `:precision` option for time type columns"Sean Griffin2015-02-171-6/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 1502caefd30b137fd1a0865be34c5bbf85ba64c1. The test suite for the mysql adapter broke when this commit was used with MySQL 5.6. Conflicts: activerecord/CHANGELOG.md
* | Merge pull request #18662 from estum/foreign-key-existsYves Senn2015-02-162-15/+38
|\ \ | | | | | | | | | Add `foreign_key_exists?` method.
| * | Add methods to get foreign key matching argumentsAnton2015-01-292-40/+36
| | |
| * | Add `foreign_key_exists?` method.Anton2015-01-242-0/+27
| | |
* | | fix, `to_table` in `remove_foreign_key` should be plural.Yves Senn2015-02-161-1/+1
| | |
* | | Register adapter specific types with the global type registrySean Griffin2015-02-151-21/+0
| |/ |/| | | | | | | | | We do this in the adapter classes specifically, so the types aren't registered if we don't use that adapter. Constants under the PostgreSQL namespace for example are never loaded if we're using mysql.
* | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-121-0/+6
| |
* | Merge pull request #18888 from kamipo/refactor_quote_default_expressionRafael Mendonça França2015-02-112-6/+6
|\ \ | | | | | | Refactor `quote_default_expression`
| * | Refactor `quote_default_expression`Ryuta Kamizono2015-02-112-6/+6
| | | | | | | | | | | | | | | | | | | | | `quote_default_expression` and `quote_default_value` are almost the same handling for do not quote default function of `:uuid` columns. Rename `quote_default_value` to `quote_default_expression`, and remove duplicate code.
* | | Merge pull request #18883 from ↵Sean Griffin2015-02-111-1/+1
|\ \ \ | | | | | | | | | | | | | | | | kamipo/fix_datetime_precision_dumping_zero_for_postgresql The datetime precision with zero should be dumped
| * | | The datetime precision with zero should be dumpedRyuta Kamizono2015-02-111-1/+1
| |/ / | | | | | | | | | | | | `precision: 0` was not dumped by f1a0fa9e19b7e4ccaea191fc6cf0613880222ee7. However, `precision: 0` is valid value for PostgreSQL timestamps.
* | | fix `remove_reference` with `foreign_key: true` on MySQL. #18664.Yves Senn2015-02-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL rejects to remove an index which is used in a foreign key constraint: ``` ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_copies_on_title_id': needed in a foreign key constraint: ALTER TABLE `copies` DROP `title_id` ``` Removing the constraint before removing the column (and the index) solves this problem.
* | | Merge pull request #18890 from kamipo/remove_cast_typeYves Senn2015-02-111-1/+1
|\ \ \ | | | | | | | | Remove `cast_type` in `ColumnDefinition`
| * | | Remove `cast_type` in `ColumnDefinition`Ryuta Kamizono2015-02-111-1/+1
| |/ / | | | | | | | | | This is no longer needed.
* / / Use keyword argument in `transaction`Ryuta Kamizono2015-02-111-6/+4
|/ / | | | | | | | | The keys are already validated, so it is better to use the built-in feature to do this.
* | Refactor microsecond precision to be database agnosticSean Griffin2015-02-102-2/+7
| | | | | | | | | | | | | | | | | | | | The various databases don't actually need significantly different handling for this behavior, and they can achieve it without knowing about the type of the object. The old implementation was returning a string, which will cause problems such as breaking TZ aware attributes, and making it impossible for the adapters to supply their logic for time objects.
* | An array type is a part of `sql_type`Ryuta Kamizono2015-02-081-1/+1
| | | | | | | | | | | | `sql_type` is reused in `lookup_cast_type`. If making it a part of `sql_type` when handled array option first, it isn't necessary to do again.
* | Allow a symbol to be passed to `attribute`, in place of a type objectSean Griffin2015-02-061-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same is not true of `define_attribute`, which is meant to be the low level no-magic API that sits underneath. The differences between the two APIs are: - `attribute` - Lazy (the attribute will be defined after the schema has loaded) - Allows either a type object or a symbol - `define_attribute` - Runs immediately (might get trampled by schema loading) - Requires a type object This was the last blocker in terms of public interface requirements originally discussed for this feature back in May. All the implementation blockers have been cleared, so this feature is probably ready for release (pending one more look-over by me).