aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract
Commit message (Collapse)AuthorAgeFilesLines
...
* | Avoid using heredoc for user warningsGodfrey Chan2014-08-281-6/+5
|/ | | | | | | | | | Using heredoc would enforce line wrapping to whatever column width we decided to use in the code, making it difficult for the users to read on some consoles. This does make the source code read slightly worse and a bit more error-prone, but this seems like a fair price to pay since the primary purpose for these messages are for the users to read and the code will not stick around for too long.
* Add missing AS requireArthur Neves2014-08-191-0/+1
| | | | `strip_heredoc` method is defined on active_support/core_ext/string
* Merge pull request #16542 from ↵Rafael Mendonça França2014-08-181-1/+1
| | | | | | | | seamusabshere/numerify-pool-checkout-timeout-from-urls-4-1-stable Make sure :checkout_timeout and :dead_connection_timeout are numbers Conflicts: activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
* Add option to stop swallowing errors on callbacks.Arthur Neves2014-08-181-7/+23
| | | | | | | | | | | | | | | Currently, Active Record will rescue any errors raised within after_rollback/after_create callbacks and print them to the logs. Next versions of rails will not rescue those errors anymore, and just bubble them up, as the other callbacks. This adds a opt-in flag to enable that behaviour, of not rescuing the errors. Example: # For not swallow errors in after_commit/after_rollback config.active_record.errors_in_transactional_callbacks = true [fixes #13460]
* Merge pull request #16481 from sgrif/sg-change-default-timestampsDavid Heinemeier Hansson2014-08-172-6/+24
|\ | | | | Change the default `null` value for timestamps
| * Change the default `null` value for timestampsSean Griffin2014-08-122-6/+24
| | | | | | | | | | | | | | As per discussion, this changes the model generators to specify `null: false` for timestamp columns. A warning is now emitted if `timestamps` is called without a `null` option specified, so we can safely change the behavior when no option is specified in Rails 5.
* | Fix regression on after_commit in nested transactions.Arthur Neves2014-08-151-0/+2
| | | | | | | | | | | | | | | | | | after_commit should not run in nested transactions, however they should run once the outermost transaction gets committed. This patch fixes the problem copying the records from the Savepoint to its parent. So the RealTransaction will have all records that needs to run callbacks on it. [fixes #16425]
* | Use *_transaction methods in TransactionManagerArthur Neves2014-08-151-4/+2
| | | | | | | | | | | | Use `commit_transaction`/`rollback_transaction` on `within_new_transaction` method, so they make sure they `pop` the transaction from the stack before calling the methods `commit`/`rollback`.
* | `index_exists?` with `:name` checks specified columns.Yves Senn2014-08-131-7/+8
|/ | | | | | | | | | | | | | | [Yves Senn & Matthew Draper] The column check was embodied in the defaul index name. If the :name option was used, the specified columns were not verified at all. Given: ``` assert connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_yo_momma) ``` That index could have been defined on any field, not necessarily on `:foo_id`.
* Cleanup Transaction inheritance.Arthur Neves2014-08-051-70/+54
| | | | | | | | | Transaction class doesnt need to encapsulate the transaction state using inheritance. This removes all Transaction subclasses, and let the Transaction object controls different actions based on its own state. Basically the only actions would behave differently are `being`,`commit`,`rollback` as they could act in a savepoint or in a real transaction.
* Replace ClosedTransaction with NullTransactionArthur Neves2014-07-311-7/+4
|
* Move TransactionManager to bottom of classArthur Neves2014-07-311-67/+67
|
* Merge pull request #16341 from arthurnn/transactions_remove_beginRafael Mendonça França2014-07-311-54/+18
|\ | | | | Transactions refactoring - 2
| * Make ClosedTransaction a null objectArthur Neves2014-07-311-16/+6
| |
| * Remove parent on Transaction objectArthur Neves2014-07-311-16/+9
| |
| * Remove being/number methods from transaction classArthur Neves2014-07-311-27/+8
| |
* | Clarify how the ConnectionHandler worksJack Danger Canty2014-07-311-15/+36
|/ | | | | | | This makes the implicit description of how connection pooling works a little more explicit. It converts the examples of a model hierarchy into actual Ruby code and demonstrates how the key structure of the database.yml relates to the `establish_connection` method.
* Remove @state.parent assignment on commitArthur Neves2014-07-291-2/+1
| | | | | | | | | This piece of code was introduced on 67d8bb963d5d51fc644d6b1ca20164efb4cee6d7 , which was calling `committed?` in the `transaction_state` before calling the `committed!` method. However on 7386ffc781fca07a0c656db49fdb54678caef809, the `committed?` check was removed and replaced by a `finalized?`, which only checks if the state is not nil. Thus we can remove that line.
* Extract the transaction class to a local variableRafael Mendonça França2014-07-281-6/+2
|
* savepoint_name should return nil for non-savepoint transactionsArthur Neves2014-07-281-1/+6
| | | | Also add test to assets the savepoint name
* Transactions refactoringArthur Neves2014-07-282-38/+64
| | | | | | | Add a transaction manager per connection, so it can controls the connection responsibilities. Delegate transaction methods to transaction_manager
* Remove finishing? method from transaction.Arthur Neves2014-07-241-23/+10
| | | | | | | | | | The finishing variable on the transaction object was a work-around for the savepoint name, so after a rollback/commit the savepoint could be released with the previous name. related: 9296e6939bcc786149a07dac334267c4035b623a 60c88e64e26682a954f7c8cd6669d409ffffcc8b
* Merge pull request #16231 from Envek/type_in_referencesYves Senn2014-07-222-4/+25
|\ | | | | | | | | | | * Allow to specify a type for foreign key column in migrations * unified the docs * some cleanup in CHANGELOG
| * Allow to specify a type for foreign key column in migrationsAndrey Novikov2014-07-222-2/+10
|/ | | | [Andrey Novikov & Łukasz Sarnacki]
* Change back occurrences of SQLite(3) to sqlite3 when referring to theZachary Scott2014-07-061-1/+1
| | | | adapter, fixed from #16057 [ci skip]
* [ci skip] /sqlite/i --> SQLiteAkshay Vishnoi2014-07-061-1/+1
|
* Always pass a column with a type object to quoteSean Griffin2014-06-283-13/+8
| | | | | | | | 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.
* 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-262-26/+27
|
* 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-263-3/+9
|
* fk: rename `dependent` to `on_delete`Yves Senn2014-06-263-9/+8
|
* 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-263-2/+18
|
* fk: `:primary_key` option for non-standard pk's.Yves Senn2014-06-261-1/+3
|
* fk: generalize using `AlterTable` and `SchemaCreation`.Yves Senn2014-06-263-7/+56
|
* fk: `foreign_keys`, `add_foreign_key` and `remove_foreign_key` for MySQLYves Senn2014-06-262-0/+21
|
* Remove unused param 'conn' from ConnectionPool#releaseMindaugas Mozūras2014-06-231-3/+3
|
* Don't use column object for type casting in `quoting`Sean Griffin2014-06-181-4/+4
| | | | | | | | | 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)
* Don't type cast the default on the columnSean Griffin2014-06-171-1/+11
| | | | | | | 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.
* /mysql/i -> MySQL, Spell correct in continuation to #15555Akshay Vishnoi2014-06-142-4/+4
|
* Remove unused requireSean Griffin2014-06-111-2/+0
| | | | We're not longer using `ipaddr` in schema dumper
* Change wording of explanation about precision & scale of decimal numbers [ci ↵Prathamesh Sonpatki2014-06-041-2/+2
| | | | skip]
* Refactor quoting of binary data to not be based on the column typeSean Griffin2014-06-031-29/+38
|
* refactor, introduce `Type#type_cast_for_schema` to cast for schema.rbYves Senn2014-05-301-26/+1
| | | | | | | This removes the case statement in `SchemaDumper` and gives every `Type` the possibility to control the SchemaDumper default value output. /cc @sgrif
* Keep closer to other methods that touch @transactionArthur Neves2014-05-281-0/+4
|