aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/touch_later_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo for touch later test description. laster -> laterAbhay Nikam2019-04-051-1/+1
|
* Use `assert_no_queries` not to ignore BEGIN/COMMIT queriesRyuta Kamizono2018-10-051-1/+1
| | | | | | | | | `test_update_does_not_run_sql_if_record_has_not_changed` would pass without #18501 since `assert_queries` ignores BEGIN/COMMIT unless `ignore_none: true` is given. Since #32647, empty BEGIN/COMMIT is ommited. So we no longer need to use `assert_queries(0)` to ignore BEGIN/COMMIT in the queries.
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-2/+2
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Merge pull request #26183 from Shopify/fix-no-touching-touch-laterRafael França2016-08-161-0/+9
|\ | | | | Makes touch_later respects no_touching policy
| * Makes touch_later respects no_touching policyJean Boussier2016-08-161-0/+9
| |
* | applies new string literal convention in activerecord/testXavier Noria2016-08-061-6/+6
|/ | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* travel backFumiaki MATSUSHIMA2015-12-131-3/+3
|
* Make sure we touch all the parents when touch_later.Arthur Neves2015-12-061-2/+0
| | | | | | | | | | | | | | | | | | | | The problem was that when saving an object, we would call touch_later on the parent which wont be saved immediteally, and it wont call any callbacks. That was working one level up because we were calling touch, during the touch_later commit phase. However that still didnt solve the problem when you have a 3+ levels of parents to be touched, as calling touch would affect the parent, but it would be too late to run callbacks on its grand-parent. The solution for this, is instead, call touch_later upwards when the first touch_later is called. So we make sure all the timestamps are updated without relying on callbacks. This also removed the hard dependency BelongsTo builder had with the TouchLater module. So we can still have the old behaviour if TouchLater module is not included. [fixes 5f5e6d924973003c105feb711cefdb726f312768] [related #19324]
* Don't rely on subsecond precision being applied in testsSean Griffin2015-09-231-1/+1
| | | | | | When I originally reviewed the #20317, I believe these changes were present, but it appears that it was later updated so that they were removed. Since Travis hadn't re-run the build, this slipped through.
* use `assert_not` instead of `refute` as mentioned in our guides.Yves Senn2015-08-131-2/+2
| | | | | | | | | | | As described in the "Follow Coding Conventions" section in our contribution guide (http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) we favor `assert_not` over `refute`. While we don't usually make stylistic changes on it's own I opted to do it in this case. The reason being that test cases are usually copied as a starting point for new tests. This results in a spread of `refute` in files that have been using it already.
* Add pending test for the great-grandparent touching bug from #19324David Heinemeier Hansson2015-06-251-0/+21
|
* Batch touch parent recordsArthur Neves2015-04-081-0/+93
[fixes #18606] Make belongs_to use touch over touch_later when running the callbacks. Add more tests and small method rename Thanks Jeremy for the feedback.