aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/locking_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix broken testRafael Mendonça França2013-07-241-1/+1
| | | | quote_value is called on the object not the class
* Tidy up the "Specified column type for quote_value" changesBen Woosley2013-07-241-1/+0
| | | | | | | | | | This includes fixing typos in changelog, removing a deprecated mocha/setup test require, and preferring the `column_for_attribute` accessor over direct access to the columns_hash in the new code. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/locking/optimistic.rb
* Specified column type for quote_valueAlfred Wong2013-07-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | When calling quote_value the underlying connection sometimes requires more information about the column to properly return the correct quoted value. I ran into this issue when using optimistic locking in JRuby and the activerecord-jdbcmssql-adapter. In SQLSever 2000, we aren't allowed to insert a integer into a NVARCHAR column type so we need to format it as N'3' if we want to insert into the NVARCHAR type. Unfortuantely, without the column type being passed the connection adapter cannot properly return the correct quote value because it doesn't know to return N'3' or '3'. This patch is fairly straight forward where it just passes in the column type into the quote_value, as it already has the ability to take in the column, so it can properly handle at the connection level. I've added the tests required to make sure that the quote_value method is being passed the column type so that the underlying connection can determine how to quote the value. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/locking/optimistic.rb
* fix testJon Leighton2012-11-131-3/+3
| | | | | Conflicts: activerecord/test/cases/locking_test.rb
* Fix deleting from a HABTM join table upon destroying an object of a model ↵Nick Rogers2012-11-131-1/+11
| | | | with optimistic locking enabled. Fixes #5332.
* Use a model without counter cache to test read-only attributesRafael Mendonça França2012-08-211-9/+10
|
* Merge pull request #4531 from exviva/pessimistic_with_lockAaron Patterson2012-01-191-0/+20
| | | | Add ActiveRecord::Base#with_lock
* Fix up test altering global state that was causing me griefJon Leighton2011-12-011-2/+4
|
* Deprecated `define_attr_method` in `ActiveModel::AttributeMethods`Jon Leighton2011-11-291-1/+3
| | | | | This only existed to support methods like `set_table_name` in Active Record, which are themselves being deprecated.
* Deprecate set_locking_column in favour of self.locking_column=Jon Leighton2011-11-291-1/+41
|
* Deprecate set_table_name in favour of self.table_name= or defining your own ↵Jon Leighton2011-11-291-1/+1
| | | | method.
* Includes stale record in StaleObjectErrorChristian Bäuerlein2011-10-141-1/+18
|
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* Don't quote ID's as Arel will quote them -- follow same conventions as the ↵Christopher Meiklejohn2011-05-081-1/+35
| | | | delete method.
* The optimistic lock column should be increased when calling touchFranck Verrot2011-02-091-0/+8
| | | | Signed-off-by: Santiago Pastorino and José Ignacio Costa <santiago+jose@wyeworks.com>
* this test requires the job model, so we should require itAaron Patterson2011-02-081-0/+1
|
* fixing bug where 1.8 hangs while running pg testsAaron Patterson2011-01-181-1/+1
|
* In a number of places in the tests, we only need to turn off transactional ↵Jon Leighton2011-01-111-25/+29
| | | | fixtures when the DB does not support savepoints. This speeds the test run up by about 8-9% on my computer, when running rake test_sqlite3_mem :)
* Enable the sqlite3 in-memory test connection to workJon Leighton2011-01-111-2/+2
|
* Don't depend on rubygems loading thread (for Mutex)raggi2010-11-251-0/+1
|
* clear any stale connections before messing with threaded testsAaron Patterson2010-10-131-0/+1
|
* Update the ActiveRecord tests to not set unused optionsCarl Lerche2010-10-131-2/+0
| | | This makes a test fail, but it is revealing a bug in Arel master.
* Set destroyed=true in opt locking's destroy [#5058 state:resolved]Jacob Lewallen2010-07-141-1/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-3/+6
|
* Destroy respects optimistic locking.Curtis Hawthorne2010-04-271-3/+48
| | | | | | | | | | 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>
* Don't publicize with_scope for tests since it may shadow public misuseJeremy Kemper2009-12-281-1/+1
|
* Revert "Ensure Model#destroy respects optimistic locking"Jeremy Kemper2009-11-171-18/+0
| | | | | | | | | | [#1966 state:open] This reverts commit 0d922885fb54c19f04680482f024452859218910. Conflicts: activerecord/lib/active_record/locking/optimistic.rb
* Ruby 1.9: skip pg locking test for 1.9.1 alsoJeremy Kemper2009-11-151-1/+1
|
* Skip pg locking test due to connection checkout deadlock detectionJeremy Kemper2009-11-141-5/+8
|
* Ensure Model#destroy respects optimistic locking [#1966 state:resolved]Curtis Hawthorne2009-03-091-0/+18
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.Jeremy Kemper2009-03-081-5/+5
| | | | [#1617 state:resolved]
* Remove SQL Server cases from tests for latest adapter work to pass rails ↵Ken Collins2008-11-191-2/+2
| | | | | | expected behavior. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Default connection allow_concurrency to false (for PostgreSQL)Nick Sieger2008-09-041-0/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Make clear_active_connections! also return stale connections back to the poolNick Sieger2008-08-291-2/+0
| | | | - also clean up some cruft remaining from per-thread connection cache
* Remove CachedConnectionPerThread per-thread pooling mechanism in favor of a ↵Nick Sieger2008-08-291-0/+2
| | | | fixed pool with default maximum of 5 connections
* Deprecate allow_concurrency and make it have no effectNick Sieger2008-08-291-7/+0
|
* Partial updates don't update lock_version if nothing changed. [#426 ↵Daniel Morrison2008-06-221-0/+20
| | | | state:resolved]
* Fixed that pessimistic locking you reference the quoted table name (Josh ↵David Heinemeier Hansson2008-04-301-1/+8
| | | | Susser) [#67 state:resolved]
* Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/railsJeremy Kemper2008-01-211-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix pathsJeremy Kemper2008-01-181-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move tests to casesJeremy Kemper2008-01-181-0/+282
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de