This project is archived and is in readonly mode.
should serialize yaml fails in ActiveModel
-
Rohit Arondekar
LH just ate the stack trace, here is a pastie: http://pastie.org/pastes/967219
-
Rohit Arondekar
Nooo! LH also ate the comparison :(. I've included it in another pastie, http://pastie.org/967270
-
Jan De Poorter
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
+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
- No changes were found…
-
Rizwan Reza
- No changes were found…
-
Anil Wadghule
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.
-
Anil Wadghule
Attached is a patch to resolve this issue
-
José Valim
Thanks Anil! Can you please rebase your patch? For some reason it does not apply anymore.
-
José Valim
- Milestone cleared.
- State changed from new to resolved
Sorry, I was applying it in the wrong repo! The patch applies with success! :P
-
Repository
(from [bdb2871df7fb0a1eeceadb31aaba4d160df508aa]) Fix xml serialization test [#4650 should serialize yaml fails in ActiveModel state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/bdb2871df7fb0a1eeceadb31aaba4d...
