aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/dirty_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add integration test for #12459George Guimarães2013-12-051-0/+8
|
* prevent `time_zone_aware_attributes` test leak. follow-up to #12633.Yves Senn2013-10-251-21/+21
|
* Removed deprecated methods partial_updates and familyNeeraj Singh2013-07-021-14/+0
| | | | | Removed deprecated methods `partial_updates`, `partial_updates?` and `partial_updates=`
* also assign nil in dirty nullable_datetime test. #10237Yves Senn2013-04-221-3/+5
|
* assigning '0.0' to a nullable numeric column does not make it dirtyYves Senn2013-03-051-0/+15
|
* Fix handling of dirty time zone aware attributesLilibeth De La Cruz2013-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when `time_zone_aware_attributes` were enabled, after changing a datetime or timestamp attribute and then changing it back to the original value, `changed_attributes` still tracked the attribute as changed. This caused `[attribute]_changed?` and `changed?` methods to return true incorrectly. Example: in_time_zone 'Paris' do order = Order.new original_time = Time.local(2012, 10, 10) order.shipped_at = original_time order.save order.changed? # => false # changing value order.shipped_at = Time.local(2013, 1, 1) order.changed? # => true # reverting to original value order.shipped_at = original_time order.changed? # => false, used to return true end
* Revert "Round usec when writing timestamp attribute."Andrew White2013-01-221-15/+0
| | | | | | | | | | This reverts commit e9d2ad395ec2ef929d74752f3d71c80674044fbe. Closes #8460 Conflicts: activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb activerecord/test/cases/dirty_test.rb
* Add failing test case for #8460Andrew White2013-01-221-0/+14
| | | | Add a test case to ensure that fractional second updates are detected.
* Revert "Merge pull request #8989 from robertomiranda/use-rails-4-find-by"Guillermo Iguaran2013-01-181-7/+7
| | | | | This reverts commit 637a7d9d357a0f3f725b0548282ca8c5e7d4af4a, reversing changes made to 5937bd02dee112646469848d7fe8a8bfcef5b4c1.
* User Rails 4 find_byrobertomiranda2013-01-181-7/+7
|
* Rename update_attributes method to update, keep update_attributes as an aliasAmparo Luna + Guillermo Iguaran2013-01-031-1/+1
|
* Remove observers and sweepersRafael Mendonça França2012-11-281-1/+1
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* Use assert_nil instead of assert_equalRafael Mendonça França2012-11-281-2/+2
|
* Don't call will_change! for datetime nil->"".Alisdair McDiarmid2012-11-251-0/+14
| | | | | | | Setting a nil datetime attribute to a blank string should not cause the attribute to be dirty. Fix #8310
* Fix typo in module name and make #in_time_zone privateCarlos Antonio da Silva2012-11-171-1/+1
|
* Extract #in_time_zone helper method duplication to a moduleCarlos Antonio da Silva2012-11-171-12/+2
|
* Remove return guardCarlos Antonio da Silva2012-11-171-1/+0
|
* Rename the partial_updates config to partial_writesJon Leighton2012-10-191-15/+29
| | | | This reflects the fact that it now impact inserts as well as updates.
* Change query pattern case insensitiveYasuo Honda2012-09-291-1/+1
| | | | because Oracle adapter uses upper case attribute/column name.
* Support for partial inserts.Jon Leighton2012-09-281-0/+25
| | | | | | | | | | | When inserting new records, only the fields which have been changed from the defaults will actually be included in the INSERT statement. The other fields will be populated by the database. This is more efficient, and also means that it will be safe to remove database columns without getting subsequent errors in running app processes (so long as the code in those processes doesn't contain any references to the removed column).
* Revert "Remove update_attribute."Rafael Mendonça França2012-08-251-1/+11
| | | | | | | | | | | 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
* Round usec when writing timestamp attribute.kennyj2012-08-211-0/+15
|
* Do not consider the numeric attribute as changed if the old value isRafael Mendonça França2012-08-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | | zero and the new value is not a string. Before this commit this was the behavior r = Review.find_by_issue(0) r.issue => 0 r.changes => {} r.issue = 0 => 0 r.changed? => true r.changes => {"issue"=>[0,0]} Fixes #7237 Conflicts: activerecord/CHANGELOG.md
* Deprecate update_column in favor of update_columns.Rafael Mendonça França2012-07-241-1/+1
| | | | Closes #1190
* Remove unneded tests.Rafael Mendonça França2012-06-141-11/+1
| | | | | | | Before 7f4b0a1231bf3c65db2ad4066da78c3da5ffb01, this test are asserting that update_attribute does the dirty tracking. Since we remove this method and update_column write in the database directly this tests will always fail>
* Remove update_attribute.Steve Klabnik2012-06-141-1/+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
* Add failing test for 3.2.5 datetime attribute regressionEvan Arnold2012-06-041-0/+11
|
* remove deprecate #update_all usageJon Leighton2012-04-261-2/+2
|
* A test case for GH #3544 to ensure that a field named field works fineAkira Matsuda2012-02-141-0/+14
|
* 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.
* Added new #update_column method.Sebastian Martinez2011-03-271-1/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Revert "Removed #update_attribute method. New #update_column method."Sebastian Martinez2011-03-271-3/+2
| | | | | | This reverts commit 45c233ef819dc7b67e259dd73f24721fec28b8c8. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Removed #update_attribute method. New #update_column method.Sebastian Martinez2011-03-261-2/+3
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fixing dup regressionsAaron Patterson2010-11-231-4/+4
|
* Ensure save always updates timestamps when serialized attributes are presentPratik Naik2010-11-021-0/+14
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-7/+7
| | | | 's/[ \t]*$//' -i {} \;)
* Make update_attribute behave as in Rails 2.3 and document the behavior ↵José Valim2010-08-121-3/+4
| | | | intrinsic to its implementation.
* This patch changes update_attribute implementatino so:Neeraj Singh2010-07-081-4/+3
| | | | | | | | | | - it will only save the attribute it has been asked to save and not all dirty attributes - it does not invoke callbacks - it does change updated_at/on Signed-off-by: José Valim <jose.valim@gmail.com>
* Use better assertion methods for testingNeeraj Singh2010-05-191-2/+2
| | | | | | [#4645 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* a cloned object no longer mimics changed flags from creator , plus a test ↵Federico Brubacher2010-05-161-0/+9
| | | | | | case [#4614 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Dirty datetime attributes should be aware of time zone info [#3658 ↵Kristopher Murata2010-04-081-0/+95
| | | | | | state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Hack to keep column metadata queries out of test query countsJeremy Kemper2010-03-151-0/+5
|
* Replace Model.first(options) with new finder methods inside testsPratik Naik2009-12-271-1/+1
|
* I added this feature so that a Map of changed fields could be retrievedJosh Sharpe2009-08-311-0/+78
| | | | | | | | | | | | | | | | | | | | after a model had been saved. This is useful in the after_save callback when you need to know what fields changed. At present there is no way to do this other than have code in the before_save callback that takes a copy of the changes Map, which I thought was a bit messy. Example. person = Person.find_by_name('bob') person.name = 'robert' person.changes # => {'name' => ['bob, 'robert']} person.save person.changes # => {} person.previous_changes # => {'name' => ['bob, 'robert']} person.reload person.previous_changes # => {} Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Serialized attributes should only be saved with partial_updates when the ↵Mike Breen2009-08-091-0/+10
| | | | | | serialized attribute is present [#2397 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added reset_attribute! method to ActiveRecord::AttributeMethods::Dirty which ↵Paul Gillard2009-08-041-0/+10
| | | | | | will reset an attribute to its original value should it have changed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.Jeremy Kemper2009-03-081-1/+1
| | | | [#1617 state:resolved]
* Add support for nested object forms to ActiveRecord and the helpers in ↵Eloy Duran2009-02-011-1/+1
| | | | | | | | ActionPack Signed-Off-By: Michael Koziarski <michael@koziarski.com> [#1202 state:committed]
* Fix dirty handling of nullable non-integer numeric columns [#1692 ↵Carlos Kozuszko2009-01-161-0/+24
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>