aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/transactions.rb
Commit message (Collapse)AuthorAgeFilesLines
* documents after_(commit|rollback)Xavier Noria2012-08-301-0/+18
|
* Merge pull request #6073 from daveyeu/restore-state-on-record-invalidRafael Mendonça França2012-08-111-1/+1
| | | | | | Restore state on create when ActiveRecord::RecordInvalid is raised Conflicts: activerecord/CHANGELOG.md
* Restore the frozen state on rollback. Fixes #6417.Godfrey Chan2012-05-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | This is a 3-2-stable backport for #6420 which was merged into master. Currently, when saving a frozen record, an exception would be thrown which causes a rollback. However, there is a bug in active record that "defrost" the record as a side effect: >> t = Topic.new => #<Topic id: nil, ...> >> t.freeze => #<Topic id: nil, ...> >> t.save RuntimeError: can't modify a frozen Hash >> t.frozen? => false >> t.save => true This patch fixes the bug by explictly restoring the frozen state on the attributes Hash after every rollback.
* fix nodocsVijay Dev2011-12-091-5/+5
|
* Revert "Raise error on unknown primary key."Jon Leighton2011-10-051-1/+1
| | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
* Raise error on unknown primary key.Jon Leighton2011-10-051-1/+1
| | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307.
* Edited activerecord/lib/active_record/transactions.rb via GitHubAyose2011-06-011-1/+1
|
* The URL http://dev.mysql.com/doc/refman/5.0/en/savepoints.html is no longer ↵Ayose2011-06-011-1/+1
| | | | available
* Use IM when trying to load records using ID.Emilio Tagua2011-04-041-0/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-151-13/+11
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/examples/performance.rb activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/nested_attributes.rb activerecord/test/cases/relations_test.rb
| * Use run_callbacks; the generated _run_<name>_callbacks method is not a ↵John Firebaugh2011-01-311-2/+2
| | | | | | | | | | | | public interface. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
| * remove useless conditionalAaron Patterson2011-01-171-10/+8
| |
| * Allow primary_key to be an attribute when the model is a new recordSantiago Pastorino2010-12-281-2/+2
| |
* | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2010-12-201-15/+19
|\| | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb
| * reviews commit 53bbbccXavier Noria2010-12-111-9/+11
| |
| * Fix doc about nested transaction rollbackIvan Evtukhovich2010-12-091-1/+2
| | | | | | | | | | Because AR::Rollback do not reraise and inner transaction is not "real" nothing rollback at all
| * Partialy revert f1c13b0dd7b22b5f6289ca1a09f1d7a8c7c8584bJosé Valim2010-11-281-7/+8
| |
* | Remove object from identity map if transaction failed.Emilio Tagua2010-11-191-0/+1
|/
* Don't check if persisted is defined just initialize it properlySantiago Pastorino2010-11-091-1/+0
|
* use persisted? instead of new_record? wherever possibleDavid Chelimsky2010-11-091-6/+7
| | | | | | | | | | | - persisted? is the API defined in ActiveModel - makes it easier for extension libraries to conform to ActiveModel APIs without concern for whether the extended object is specifically ActiveRecord [#5927 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* #transaction on the instance level should take options as wellCarl Lerche2010-10-141-2/+2
|
* Merge remote branch 'rails/master'Xavier Noria2010-06-201-0/+1
|\ | | | | | | | | Conflicts: actionpack/lib/abstract_controller/base.rb
| * Fix bug with rolling back frozen attributes.Brian Durand2010-06-181-0/+1
| | | | | | | | | | | | [#2991] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Adds title to the rest of the files in activerecord/libRizwan Reza2010-06-161-2/+4
|/
* Make logic for after_commit and after_rollback :on option work like it does ↵Brian Durand2010-06-081-18/+33
| | | | | | | | for validation callbacks. [#2991 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "Temporarily revert "Update after_commit and after_rollback docs and ↵Jeremy Kemper2010-06-081-9/+109
| | | | | | | | tests to use new style API with an :on options instead of on_* suffix." and "Add after_commit and after_rollback callbacks to ActiveRecord that are called after transactions either commit or rollback on all records saved or destroyed in the transaction."" This reverts commit 1b2941cba1165b0721f57524645fe378bee2a950. [#2991]
* Temporarily revert "Update after_commit and after_rollback docs and tests to ↵Jeremy Kemper2010-06-081-109/+9
| | | | | | | | | | | | | | use new style API with an :on options instead of on_* suffix." and "Add after_commit and after_rollback callbacks to ActiveRecord that are called after transactions either commit or rollback on all records saved or destroyed in the transaction." This reverts commits d2a49e4b1f30c5997e169110eed94a55aee53f56 and da840d13da865331297d5287391231b1ed39721b. [#2991] Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/transactions.rb activerecord/test/cases/transaction_callbacks_test.rb
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-12/+10
|
* edit pass in the transactions preamble rdocXavier Noria2010-05-021-24/+31
|
* after_(commit|rollback) rdoc, edit passXavier Noria2010-04-301-5/+5
|
* Update after_commit and after_rollback docs and tests to use new style API ↵Brian Durand2010-04-291-5/+0
| | | | | | | | with an :on options instead of on_* suffix. [#2991] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add after_commit and after_rollback callbacks to ActiveRecord that are ↵Brian Durand2010-04-291-14/+117
| | | | | | | | called after transactions either commit or rollback on all records saved or destroyed in the transaction. [#2991 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* save(false) is gone, use save(:validate => false) instead.José Valim2010-01-171-2/+2
|
* Break up DependencyModule's dual function of providing a "depend_on" DSL and ↵Joshua Peek2009-05-281-1/+1
| | | | "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
* Use DependencyModule for included hooks in ActiveRecordBryan Helmkamp2009-05-111-7/+5
|
* Merge docrailsPratik Naik2009-04-051-0/+2
|
* Revert "Wrap calls to update_attributes in a transaction."Michael Koziarski2009-02-221-15/+1
| | | | | | | This caused failures on sqlite, sqlite3 and postgresql This reverts commit fc09ebc669bd58f415f7d3ef932ef02dab821ab5. [#922 state:reopened]
* Wrap calls to update_attributes in a transaction.Xavier Noria2009-02-221-1/+15
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#922 state:committed]
* Introduce transaction_joinable flag to mark that the fixtures transaction ↵Jeremy Kemper2009-01-101-15/+12
| | | | | | can't joined, a new savepoint is required even if :requires_new is not set. Use :requires_new option instead of :nest. Update changelog. [#383 state:committed]
* Merge branch 'master' into savepointsJeremy Kemper2009-01-101-2/+2
|\
| * Don't use the transaction instance method so that people with ↵Frederick Cheung2008-12-101-2/+2
| | | | | | | | | | | | | | | | has_one/belongs_to :transaction aren't fubared [#1551 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Rename ActiveRecord::Base#transaction's :force option to :nest. Improve ↵Hongli Lai (Phusion)2008-11-031-2/+57
| | | | | | | | documentation for nested transactions.
* | Improve documentation for DatabaseStatements#transactions and ↵Hongli Lai (Phusion)2008-11-031-0/+2
| | | | | | | | AbstractAdapter#transactional_fixtures, especially with regard to support for nested transactions.
* | Implement savepoints.Jonathan Viney2008-11-031-8/+4
|/
* Merge docrailsPratik Naik2008-10-051-18/+69
|
* Merge docrailsPratik Naik2008-09-031-1/+1
|
* Rollback the transaction when a before_* callback returns false.Xavier Noria2008-08-241-2/+14
| | | | | | | Previously this would have committed the transaction but not carried out save or destroy operation. [#891 state:committed] Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Merge docrails changesPratik Naik2008-07-281-3/+6
|
* Move the transaction counter to the connection object rather than ↵Jonathan Viney2008-07-151-14/+3
| | | | | | | maintaining it on the current Thread. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#533 state:resolved]
* Merge docrails.Pratik Naik2008-05-251-2/+2
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>