This project is archived and is in readonly mode.
Touch-ing with counter cache results in an erro
-
José Valim
- Importance changed from to Low
Could you please add a failing test case to Rails test suite?
-
Neil Middleton
Hi José,
I would love to, but am not sure how, and therefore can't be sure that the test would be correct.
N
-
Mark Turner
This isn't a bug. When you use a symbol with :touch it attempts to update an attribute with that same name. He just needs to use :touch => true to update the updated_at field.
-
Neil Middleton
OK - had a stab at it - I've altered the models so that the issue causes some tests to fail.
-
Mark Turner
Here is a passing test using the correct syntax for touch.
-
Neil Middleton
@Mark it seems you're correct. In my app this is now working as it should. However, I'm not sure how this was previously working prior to rails3.0.0.rc
-
Mark Turner
@Niel, you did find a corner case we didn't have a test for.
-
Neil Middleton
@Mark - well, it's nice to make a rails contribution - no matter how small ;)
-
Mark Turner
- Tag changed from activerecord rails3, rails 3.0.0.rc, touch to activerecord rails3, rails 3.0.0.rc, patch, touch
-
Mark Turner
- Assigned user set to Santiago Pastorino
-
Mark Turner
- Title changed from Touch-ing with counter cache results in an error to Touch-ing with counter cache results in an erro
Any word on the test patch I added?
-
Repository
- State changed from new to committed
(from [6177a0be96cebac129d0e20d2b5ec009a00fa56c]) added testcase for belongs_to with a counter_cache and touch
[#5365 Touch-ing with counter cache results in an erro state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/6177a0be96cebac129d0e20d2b5ec0... -
Repository
(from [f1b33f7f22b7cddb7a80afbfa134a62600391b22]) Restore pet -> owner relationship to the previous state
[#5365 Touch-ing with counter cache results in an erro] http://github.com/rails/rails/commit/f1b33f7f22b7cddb7a80afbfa134a6...
-
Repository
(from [6f478b06989ee10b63c9581b266b60bb946afd4f]) Restore pet -> owner relationship to the previous state
[#5365 Touch-ing with counter cache results in an erro] http://github.com/rails/rails/commit/6f478b06989ee10b63c9581b266b60...
-
Repository
(from [fc43c62fc68bc6a75fd57c2da252ede00dd319ba]) added testcase for belongs_to with a counter_cache and touch
[#5365 Touch-ing with counter cache results in an erro state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/fc43c62fc68bc6a75fd57c2da252ed...
