aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/locking
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove instance level quote_value method. This method is private and also ↵kennyj2012-07-141-1/+1
| | | | exists in class method.
* Simplify AR configuration code.Jon Leighton2012-06-151-2/+6
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* Fix #5797. Error calling dup method on AR model with serialized fieldkennyj2012-05-301-1/+1
|
* clear up duplication between Persistence#destroy and Locking#destroyJon Leighton2012-03-301-14/+17
|
* Merge pull request #5334 from courtland/masterJon Leighton2012-03-301-0/+2
|\ | | | | Fix deleting from a HABTM join table upon destroying an object of a model with optimistic locking enabled.
| * Fix deleting from a HABTM join table upon destroying an object of a model ↵Nick Rogers2012-03-071-0/+2
| | | | | | | | with optimistic locking enabled. Issue #5332.
* | Removed flag attributes.Robin Roestenburg2012-03-061-1/+1
|/
* Remove unusused variablesJon Leighton2012-03-041-2/+1
|
* Improve readonly examples and optimistic locking docsCarlos Antonio da Silva2012-01-311-4/+6
| | | | | | | | | * Relation#order can receive order attributes as different arguments, add example; * Readonly does not handle deletion of records, only modification; * locking_version column does not need to default to 0, Rails handles nil values; * Change references from "set_locking_column" to "self.locking_column".
* Add ActiveRecord::Base#with_lockOlek Janiszewski2012-01-181-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a `with_lock` method to ActiveRecord objects, which starts a transaction, locks the object (pessimistically) and yields to the block. The method takes one (optional) parameter and passes it to `lock!`. Before: class Order < ActiveRecord::Base def cancel! transaction do lock! # ... cancelling logic end end end After: class Order < ActiveRecord::Base def cancel! with_lock do # ... cancelling logic end end end
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-281-1/+4
| | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present.
* Deal with global config better between AR::Base and AR::ModelJon Leighton2011-12-241-4/+1
|
* Make read_attribute code path accessible at the class levelJon Leighton2011-12-221-15/+12
|
* remove deprecated set and original methods for table_name, primary_key, etcSergey Nartimov2011-12-211-9/+1
|
* Avoid super; speeds up Model.new by about 12%Jon Leighton2011-12-141-1/+1
|
* Deprecate set_locking_column in favour of self.locking_column=Jon Leighton2011-11-291-8/+13
|
* Added a note that optimistic locking also needs a hidden field to function ↵Joost Baaij2011-10-251-0/+3
| | | | across web workers.
* Consider attempted action in exception message of ActiveRecord::StaleObjectErrorChristian Bäuerlein2011-10-141-2/+2
|
* Includes stale record in StaleObjectErrorChristian Bäuerlein2011-10-141-2/+2
|
* Make it the responsibility of the connection to hold onto an ARel visitor ↵Jon Leighton2011-08-081-2/+2
| | | | for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now.
* lock_optimistically is typically true, so evaluate the common failure case firstAaron Patterson2011-06-281-1/+1
|
* Closes GH #1032John Paul Ashenfelter2011-05-191-1/+1
| | | | Fixed what looks like minor cut/paste error in documentation for ActiveRecord::Locking:Pessimistic
* Better doc styling in ActiveRecord::LockingSebastian Martinez2011-05-172-17/+17
|
* Don't quote ID's as Arel will quote them -- follow same conventions as the ↵Christopher Meiklejohn2011-05-081-1/+1
| | | | delete method.
* remove some blanksPaco Guzman2011-03-112-4/+4
|
* fixed broken link to postgresql docsSergii Boiko2011-02-151-1/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* removed some duplication from LH issue 5505 regarding AR touch and ↵Josh Kalderimis2011-02-091-4/+10
| | | | | | optimistic locking [#5505 state:resolved] Signed-off-by: Santiago Pastorino and José Ignacio Costa <santiago+jose@wyeworks.com>
* removing more calls to deprecated methodsAaron Patterson2010-12-021-2/+4
|
* Remove explicit return.Emilio Tagua2010-11-251-1/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Reuse lock_col variable instead calling locking_column class method.Emilio Tagua2010-11-251-3/+4
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Don't create local vars.Emilio Tagua2010-11-241-4/+1
|
* use persisted? instead of new_record? wherever possibleDavid Chelimsky2010-11-092-2/+2
| | | | | | | | | | | - 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>
* Use new finders syntax in docs.Emilio Tagua2010-09-011-3/+3
|
* Set destroyed=true in opt locking's destroy [#5058 state:resolved]Jacob Lewallen2010-07-141-0/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Use arel instead of sql stringsPratik Naik2010-05-111-6/+5
|
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-19/+8
|
* Destroy respects optimistic locking.Curtis Hawthorne2010-04-271-1/+34
| | | | | | | | | | Now works with :dependent => :destroy and includes unit tests for that case. Also includes better error messages when updating/deleting stale objects. [#1966 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Dont delegate Relation#update to arelPratik Naik2010-01-201-1/+1
|
* Give preference to to_a over arel from Relation#method_missingPratik Naik2010-01-191-2/+2
|
* Rename Model.active_relation to Model.unscopedPratik Naik2010-01-171-1/+1
|
* Rename Model.arel_table to Model.active_relationPratik Naik2010-01-021-4/+4
|
* Remove unncessary arguments passed to arel_tablePratik Naik2010-01-011-1/+1
|
* Revert "Ensure Model#destroy respects optimistic locking"Jeremy Kemper2009-11-171-34/+0
| | | | | | | | | | [#1966 state:open] This reverts commit 0d922885fb54c19f04680482f024452859218910. Conflicts: activerecord/lib/active_record/locking/optimistic.rb
* Merge commit 'rails/master'Emilio Tagua2009-09-141-22/+0
|\
| * Removed the copyright notice not to show it in the result of 'ri ActiveRecord'.Shugo Maeda2009-09-111-22/+0
| |
* | Cache arel_table when possible, use class method arel_table insteadEmilio Tagua2009-08-181-2/+6
| | | | | | | | instance method.
* | Performance: cache/reload arel relation when possible to speed up things.Emilio Tagua2009-07-211-2/+2
| |
* | Merge commit 'rails/master'Emilio Tagua2009-06-021-1/+1
|\| | | | | | | | | | | Conflicts: activerecord/lib/active_record.rb
| * 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.
* | Merge commit 'rails/master'Emilio Tagua2009-05-121-8/+8
|\|