This project is archived and is in readonly mode.
should serialize yaml fails in ActiveModel
Reported by Rohit Arondekar | May 19th, 2010 @ 08:59 AM | in 3.0.2
There is 1 failure in the testsuite of ActiveModel, Rails master on 1.9.2-head
The stacktrace is as follows:
1) Failure: test_should_serialize_yaml(XmlSerializationTest)
[/home/rohit/remote-repos/rails_patches/working3/activemodel/test/cases/serializeration/xml_serialization_test.rb:107]:
Expected /\n\n aaron stack\n
Thanks to DefV from #rails-contrib, who has confirmed that the tests pass on 1.8.7
I noticed that on 1.9.2 the output of serializing the yaml was:
Note that a field(is it a field?) modifiable: true is extra on 1.9.2. I tried looking at the OpenStruct docs and did a little Googling around but couldn't find any more information.
Comments and changes to this ticket
-
Rohit Arondekar May 19th, 2010 @ 09:00 AM
LH just ate the stack trace, here is a pastie: http://pastie.org/pastes/967219
-
Rohit Arondekar May 19th, 2010 @ 09:05 AM
Nooo! LH also ate the comparison :(. I've included it in another pastie, http://pastie.org/967270
-
Jan De Poorter May 19th, 2010 @ 09:46 AM
Looks like this change adds @modifiable variable to OpenStruct if you call a setter method on an OpenStruct. If you create the OpenStruct with values in the initializer the test passes
Fri Feb 27 14:23:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/ostruct.rb (modifiable): check if really frozen. [ruby-core:22559]
Patch attached.
-
Rohit Arondekar May 19th, 2010 @ 10:53 AM
+1 for the patch BUT, what if the programmer can't use the initializer to create the struct, what if he has to use setter methods? Shouldn't Rails remove the modifiable: true from the output? Because it's not semantically part of the struct the programmer created.
-
Rizwan Reza May 19th, 2010 @ 11:00 AM
- no changes were found...
-
Rizwan Reza May 19th, 2010 @ 11:26 AM
- no changes were found...
-
Anil Wadghule May 19th, 2010 @ 11:52 AM
I think we can use any other ruby object of other class e.g. Struct. OpenStruct behaves differently on different rubies. See here http://pastie.org/967363. I am sumitting a patch.
-
José Valim May 19th, 2010 @ 12:01 PM
Thanks Anil! Can you please rebase your patch? For some reason it does not apply anymore.
-
José Valim May 19th, 2010 @ 12:02 PM
- Milestone cleared.
- State changed from new to resolved
Sorry, I was applying it in the wrong repo! The patch applies with success! :P
-
Repository May 19th, 2010 @ 12:03 PM
(from [bdb2871df7fb0a1eeceadb31aaba4d160df508aa]) Fix xml serialization test [#4650 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/bdb2871df7fb0a1eeceadb31aaba4d... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 4650 should serialize yaml fails in ActiveModel (from [bdb2871df7fb0a1eeceadb31aaba4d160df508aa]) Fix xml...