This project is archived and is in readonly mode.
[PATCH] ActiveRecord::Base#reload didn't respect default_scope conditions
-
Tobi
ehm, and the patch attached ;-)
-
Tobi
- Tag set to 2.3.4, activerecord, default_scope, patch, reload, with_exclusive_scope
-
Tobi
there was an issue with protected method. is fixed, see updated patch
-
CancelProfileIsBroken
- Tag changed from 2.3.4, activerecord, default_scope, patch, reload, with_exclusive_scope to 2.3.4, activerecord, bugmash, default_scope, patch, reload, with_exclusive_scope
-
John Guenin
+1 verified bug & patch.
Patch applies cleanly to master & 2-3-stable.
Good catch!
-
rbxbx
+1 patch applies cleanly to master and stable, tests passing.
:)
-
CancelProfileIsBroken
- Tag changed from 2.3.4, activerecord, bugmash, default_scope, patch, reload, with_exclusive_scope to 2.3.4, activerecord, bugmash-review, default_scope, patch, reload, with_exclusive_scope
-
José Valim
- Assigned user set to José Valim
-
Repository
(from [b06e5dce9786bf69ac5f114286fc9236dc9bfe5c]) fixed a 'RecordNotFound' bug when calling 'reload' on a object which doesn't met the default_scope conditions, added test [#3166 [PATCH] ActiveRecord::Base#reload didn't respect default_scope conditions status:resolved]
The reload method didn't made use of 'with_exclusive_scope' when reloading the object. This lead to a RecordNotFound exception, in case the object doesn't met the default_scope condition (anymore) - which is obviously a bug. This quick fix makes use of with_exclusive_scope in the reload method as well. See test for full example.
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/b06e5dce9786bf69ac5f114286fc92... -
Repository
(from [4db72b702f7faca7da30a64e45daeee13733762a]) fixed a 'RecordNotFound' bug when calling 'reload' on a object which doesn't met the default_scope conditions, added test [#3166 [PATCH] ActiveRecord::Base#reload didn't respect default_scope conditions status:resolved]
The reload method didn't made use of 'with_exclusive_scope' when reloading the object. This lead to a RecordNotFound exception, in case the object doesn't met the default_scope condition (anymore) - which is obviously a bug. This quick fix makes use of with_exclusive_scope in the reload method as well. See test for full example.
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/4db72b702f7faca7da30a64e45daee... -
Rizwan Reza
- Tag changed from 2.3.4, activerecord, bugmash-review, default_scope, patch, reload, with_exclusive_scope to 2.3.4, activerecord, default_scope, patch, reload, with_exclusive_scope
