This project is archived and is in readonly mode.
Cloned object mimic changed_attributes from creator after being clonde
-
pleax
Verified. Reproduces on master.
-
José Valim
- Milestone cleared.
- Tag changed from 3.0, activerecord, dirty to 3.0, activerecord, bugmash, dirty
-
Federico Brubacher
- Tag changed from 3.0, activerecord, bugmash, dirty to 3.0, activerecord, dirty
I've attached a patch.
This patch includes the test case that no longer fails and a fix.
-
Federico Brubacher
- Tag changed from 3.0, activerecord, dirty to 3.0, activerecord, dirty, patch
-
Federico Brubacher
- Tag changed from 3.0, activerecord, dirty, patch to 3.0, activerecord, bugmash, dirty, patch
-
Wijnand Wiersma
+1 patch works fine, tests pass
-
PacoGuzman
+1 patch applies clean, all test pass
-
José Valim
- Assigned user set to José Valim
Federico, could you change your patch to make changed_attributes a public method, so we don't need to use instance_variable_get?
-
Federico Brubacher
Jose, here is the patch with marked attributes as public
-
Santiago Pastorino
- Tag changed from 3.0, activerecord, bugmash, dirty, patch to 3.0, activerecord, bugmash, bugmash-review, dirty, patch
- State changed from new to verified
Great federico +1
-
Rizwan Reza
- Tag changed from 3.0, activerecord, bugmash, bugmash-review, dirty, patch to 3.0, activerecord, bugmash-review, dirty, patch
-
PacoGuzman
+1
-
Repository
- State changed from verified to resolved
(from [6b4e0cc526f55b5532cf99292c94f0a4db53b16f]) a cloned object no longer mimics changed flags from creator , plus a test case [#4614 Cloned object mimic changed_attributes from creator after being clonde state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/6b4e0cc526f55b5532cf99292c94f0... -
Matt Jones
Quick question: how does this interact with the issue from #2919 Activerecord::Base#clone does not set dirty bits?
Also note that the use of
dupto create the new changed_attributes means another place where dirty tracking combined with serialized attributes can go awry (see also #3474 _was doesn't work correctly for serialized fields with nested elements). -
Rizwan Reza
- Tag changed from 3.0, activerecord, bugmash-review, dirty, patch to 3.0, activerecord, dirty, patch
-
joson
Very nice, thank you for you sharing. A Replica Breitling is a timepiece of high quality and functionality and you will have all the class, prestige and luxury of a wealthy, successful individual. By choosing from our selection of luxury Replica Watches , you can improve your self-esteem and feel confident to enter new circles of business associates and friends. These Rolex Replicas will surely enhance your style and only you will know the watch you wear did not cost you $1,000's of dollars.
.
