Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Correctly send the string given to lock! and reload(:lock) to the lock scope ↵ | Mauricio Linhares | 2014-01-29 | 1 | -0/+11 |
| | | | | | | - fixes #13788 As per the documentation at lock!, if the :lock option is a string it should use the given SQL to generate the lock statement. | ||||
* | Deprecate unused quoted_locking_column method. | kennyj | 2013-09-24 | 1 | -0/+4 |
| | |||||
* | Tidy up the "Specified column type for quote_value" changes | Ben Woosley | 2013-07-22 | 1 | -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. | ||||
* | Specified column type for quote_value | Alfred Wong | 2013-07-22 | 1 | -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. | ||||
* | Reset @column_defaults when assigning . | kennyj | 2013-07-14 | 1 | -0/+1 |
| | |||||
* | Do not invoke callbacks when delete_all is called | Neeraj Singh | 2013-06-30 | 1 | -0/+1 |
| | | | | | | | | | | | Method `delete_all` should not be invoking callbacks and this feature was deprecated in Rails 4.0. This is being removed. `delete_all` will continue to honor the `:dependent` option. However if `:dependent` value is `:destroy` then the default deletion strategy for that collection will be applied. User can also force a deletion strategy by passing parameter to `delete_all`. For example you can do `@post.comments.delete_all(:nullify)` | ||||
* | indentation | Aaron Patterson | 2013-06-11 | 1 | -1/+1 |
| | |||||
* | Fix ActiveRecord locking column defaults not getting persisted | Aaron Pfeifer | 2013-03-18 | 1 | -0/+8 |
| | | | | | | | | | | | When partial inserts are enabled, overridden db defaults are ignored. This results in locking columns having a nil value for new records if the db default is null. This happens because the list of changed attributes for new records is always assumed to be empty. Solution: When a new record's default attributes are set, also initialize the list of changed attributes by comparing current values against what's stored as the column defaults in the database. | ||||
* | remove ancient TODOs [ci skip]. | Yves Senn | 2013-03-18 | 1 | -3/+0 |
| | |||||
* | Rename update_attributes method to update, keep update_attributes as an alias | Amparo Luna + Guillermo Iguaran | 2013-01-03 | 1 | -1/+1 |
| | |||||
* | Use a model without counter cache to test read-only attributes | Rafael Mendonça França | 2012-08-21 | 1 | -9/+10 |
| | |||||
* | removed deprecation warnings | Andrey Deryabin | 2012-04-28 | 1 | -2/+2 |
| | |||||
* | remove calls to find(:first), find(:last) and find(:all) | Jon Leighton | 2012-04-26 | 1 | -1/+1 |
| | |||||
* | remove tests for #with_scope (it's now deprecated) | Jon Leighton | 2012-04-25 | 1 | -11/+0 |
| | |||||
* | fix test | Jon Leighton | 2012-03-30 | 1 | -1/+2 |
| | |||||
* | whitespace :scissors: | Jon Leighton | 2012-03-30 | 1 | -4/+3 |
| | |||||
* | Tests for removing a HABTM association when optimistic locking is enabled. | Nick Rogers | 2012-03-07 | 1 | -1/+11 |
| | |||||
* | Add ActiveRecord::Base#with_lock | Olek Janiszewski | 2012-01-18 | 1 | -0/+20 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | ||||
* | removed unnecessary +1 from assert_difference because default difference is 1 | Karunakar (Ruby) | 2012-01-05 | 1 | -1/+1 |
| | |||||
* | refactored tests -- assert_diffrence instead of checking directly with count | Karunakar (Ruby) | 2012-01-04 | 1 | -4/+7 |
| | |||||
* | Merge branch 'master' of git://github.com/rails/rails | Dmitry Polushkin | 2011-12-31 | 1 | -15/+24 |
|\ | |||||
| * | remove deprecated set and original methods for table_name, primary_key, etc | Sergey Nartimov | 2011-12-21 | 1 | -42/+0 |
| | | |||||
| * | Removed test which works only < 1.9 | Arun Agrawal | 2011-12-21 | 1 | -10/+0 |
| | | |||||
| * | Fix up test altering global state that was causing me grief | Jon Leighton | 2011-12-01 | 1 | -2/+4 |
| | | |||||
| * | Deprecated `define_attr_method` in `ActiveModel::AttributeMethods` | Jon Leighton | 2011-11-29 | 1 | -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 Leighton | 2011-11-29 | 1 | -1/+41 |
| | | |||||
| * | Deprecate set_table_name in favour of self.table_name= or defining your own ↵ | Jon Leighton | 2011-11-29 | 1 | -1/+1 |
| | | | | | | | | method. | ||||
| * | Includes stale record in StaleObjectError | Christian Bäuerlein | 2011-10-14 | 1 | -1/+18 |
| | | |||||
* | | Test polymorphic record with optimistic locking and counter cache should be ↵ | Dmitry Polushkin | 2011-09-09 | 1 | -0/+12 |
|/ | | | | destoyed without catching the ActiveRecord::StaleObjectError. | ||||
* | please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT | Aaron Patterson | 2011-06-06 | 1 | -1/+1 |
| | |||||
* | Refactor Active Record test connection setup. Please see the ↵ | Jon Leighton | 2011-06-04 | 1 | -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 Meiklejohn | 2011-05-08 | 1 | -1/+35 |
| | | | | delete method. | ||||
* | The optimistic lock column should be increased when calling touch | Franck Verrot | 2011-02-09 | 1 | -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 it | Aaron Patterson | 2011-02-08 | 1 | -0/+1 |
| | |||||
* | fixing bug where 1.8 hangs while running pg tests | Aaron Patterson | 2011-01-18 | 1 | -1/+1 |
| | |||||
* | In a number of places in the tests, we only need to turn off transactional ↵ | Jon Leighton | 2011-01-11 | 1 | -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 work | Jon Leighton | 2011-01-11 | 1 | -2/+2 |
| | |||||
* | Don't depend on rubygems loading thread (for Mutex) | raggi | 2010-11-25 | 1 | -0/+1 |
| | |||||
* | clear any stale connections before messing with threaded tests | Aaron Patterson | 2010-10-13 | 1 | -0/+1 |
| | |||||
* | Update the ActiveRecord tests to not set unused options | Carl Lerche | 2010-10-13 | 1 | -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 Lewallen | 2010-07-14 | 1 | -1/+2 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | eliminate alias_method_chain from ActiveRecord | wycats | 2010-05-09 | 1 | -3/+6 |
| | |||||
* | Destroy respects optimistic locking. | Curtis Hawthorne | 2010-04-27 | 1 | -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 misuse | Jeremy Kemper | 2009-12-28 | 1 | -1/+1 |
| | |||||
* | Revert "Ensure Model#destroy respects optimistic locking" | Jeremy Kemper | 2009-11-17 | 1 | -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 also | Jeremy Kemper | 2009-11-15 | 1 | -1/+1 |
| | |||||
* | Skip pg locking test due to connection checkout deadlock detection | Jeremy Kemper | 2009-11-14 | 1 | -5/+8 |
| | |||||
* | Ensure Model#destroy respects optimistic locking [#1966 state:resolved] | Curtis Hawthorne | 2009-03-09 | 1 | -0/+18 |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Ruby 1.9 compat: rename deprecated assert_raises to assert_raise. | Jeremy Kemper | 2009-03-08 | 1 | -5/+5 |
| | | | | [#1617 state:resolved] | ||||
* | Remove SQL Server cases from tests for latest adapter work to pass rails ↵ | Ken Collins | 2008-11-19 | 1 | -2/+2 |
| | | | | | | expected behavior. Signed-off-by: Michael Koziarski <michael@koziarski.com> |