aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/persistence_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change duplicated test nameRafael Mendonça França2013-01-031-2/+2
|
* Rename update_attributes method to update, keep update_attributes as an aliasAmparo Luna + Guillermo Iguaran2013-01-031-5/+42
|
* remove meaningless AS::FrozenObjectErrorAkira Matsuda2013-01-021-3/+2
|
* Unscope update_column(s) query to ignore default scopeCarlos Antonio da Silva2012-12-061-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | When applying default_scope to a class with a where clause, using update_column(s) could generate a query that would not properly update the record due to the where clause from the default_scope being applied to the update query. class User < ActiveRecord::Base default_scope where(active: true) end user = User.first user.active = false user.save! user.update_column(:active, true) # => false In this situation we want to skip the default_scope clause and just update the record based on the primary key. With this change: user.update_column(:active, true) # => true Fixes #8436.
* Remove not used variable warnignsCarlos Antonio da Silva2012-12-011-1/+1
|
* AR::Base.becomes should not change the STI typeThomas Hollstegge2012-11-171-1/+12
| | | | If you want to change the STI type too, use AR::Base.becomes! instead
* Enable update_column(s) for the primary key attribute.Henrik N2012-10-281-0/+13
| | | | Didn't work before because it updated the model-in-memory first, so the DB query couldn't find the record.
* Remove mass_assignment_options from ActiveRecordGuillermo Iguaran2012-09-161-40/+0
|
* Revert "Remove update_attribute."Rafael Mendonça França2012-08-251-0/+40
| | | | | | | | | | | This reverts commit a7f4b0a1231bf3c65db2ad4066da78c3da5ffb01. Conflicts: activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/persistence.rb activerecord/test/cases/base_test.rb activerecord/test/cases/dirty_test.rb activerecord/test/cases/timestamp_test.rb
* Remove the deprecation of update_column.Rafael Mendonça França2012-07-301-38/+17
| | | | | | update_column was suggested as replacement of update_attribute at the last release of 3-2-stable, so deprecating it now will confuse the users.
* Deprecate ActiveRecord::Base.scoped.Jon Leighton2012-07-271-3/+3
| | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
* ActiveRecord::Base.all returns a Relation.Jon Leighton2012-07-271-1/+1
| | | | | | | | | | | Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway.
* Deprecate update_column in favor of update_columns.Rafael Mendonça França2012-07-241-17/+38
| | | | Closes #1190
* Use update_columns to implemente the update_columnRafael Mendonça França2012-07-241-2/+36
|
* New #update_columns method.Sebastian Martinez2012-07-241-0/+57
|
* Remove update_attribute.Steve Klabnik2012-06-141-62/+1
| | | | | | | | | | | Historically, update_attribute and update_attributes are similar, but with one big difference: update_attribute does not run validations. These two methods are really easy to confuse given their similar names. Therefore, update_attribute is being removed in favor of update_column. See the thread on rails-core here: https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-core/BWPUTK7WvYA
* + ActiveRecord::Base#destroy!Marc-Andre Lafortune2012-06-061-0/+7
|
* Remove unused assignments from activerecord testsMark Rushakoff2012-04-291-1/+0
|
* remove deprecated callsJon Leighton2012-04-271-1/+1
|
* %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵Jon Leighton2012-04-271-1/+1
| | | | things
* remove deprecate #all usageJon Leighton2012-04-261-1/+1
|
* remove deprecate #update_all usageJon Leighton2012-04-261-7/+1
|
* Fix delete_all when chained with joins.Rafael Mendonça França2012-04-101-1/+19
| | | | Closes #5202 and #919
* Raise error when using write_attribute with a non-existent attribute.Jon Leighton2011-09-131-6/+11
| | | | | | | | | Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing.
* Bring back the ability to provide :order for update_all.thedarkone2011-07-251-0/+20
|
* 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.
* Ensure assign_attributes and update_attributes do not fail on nil, closes #478.José Valim2011-05-101-0/+4
|
* some test renaming to avoid collisions, and some annoying issues between dbsJosh Kalderimis2011-04-271-7/+7
|
* final corrections to the mass-assignment security testsJosh Kalderimis2011-04-271-4/+4
|
* fix mass-assignment security tests, this was due to a string column limit ↵Josh Kalderimis2011-04-271-6/+6
| | | | which doesn't cause issues on sqlite
* AR update_attributes api is updated to reflect the addition of assign_attributesJosh Kalderimis2011-04-261-0/+40
|
* Added assign_attributes to Active Record which accepts a mass-assignment ↵Josh Kalderimis2011-04-241-1/+1
| | | | security scope using the :as option, while also allowing mass-assignment security to be bypassed using :with_protected
* oracle stores this with microseconds, so convert to seconds before comparingAaron Patterson2011-03-291-1/+1
|
* Added new #update_column method.Sebastian Martinez2011-03-271-0/+86
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Revert "Removed #update_attribute method. New #update_column method."Sebastian Martinez2011-03-271-42/+46
| | | | | | This reverts commit 45c233ef819dc7b67e259dd73f24721fec28b8c8. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Removed #update_attribute method. New #update_column method.Sebastian Martinez2011-03-261-46/+42
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* removing many unused variablesAaron Patterson2010-11-161-2/+1
|
* STI type is now updated when calling AR::Base.becomes on subclasses [#5953 ↵Franck Verrot2010-11-121-0/+9
| | | | state:resolved]
* Fixing typo [#5485 state:resolved]Thiago Pradi2010-08-281-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-2/+2
| | | | 's/[ \t]*$//' -i {} \;)
* Make update_attribute behave as in Rails 2.3 and document the behavior ↵José Valim2010-08-121-17/+24
| | | | intrinsic to its implementation.
* Making Active Record base_test.rb thinner by moving testsNeeraj Singh2010-08-031-0/+113
| | | | | | | | | | | | to relevant files. Number of assertions before refactoring: 2391 tests, 7579 assertions, 0 failures, 0 errors Number of assertions after refactoring: 2391 tests, 7579 assertions, 0 failures, 0 errors Signed-off-by: José Valim <jose.valim@gmail.com>
* removing unused models from testsSubba Rao Pasupuleti2010-07-211-7/+0
| | | | | | [#5153 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* update_attribute should not update readonly attributesNeeraj Singh2010-07-211-1/+7
| | | | | | [#5106 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Makes this test don't trust on the speed of executionSantiago Pastorino2010-07-171-4/+5
|
* moving persistence related tests to a new fileNeeraj Singh2010-07-161-0/+357
Before refactoring test result from AR: 2291 tests, 7180 assertions, 0 failures, 0 errors After the refactoring test result from AR: 2291 tests, 7180 assertions, 0 failures, 0 errors Signed-off-by: José Valim <jose.valim@gmail.com>