Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix serialization of class methods

According to #306, class methods were not having their payload object
set to the correct value.

Instead of being the classname of the target class, the payload object
was getting set to Class.
  • Loading branch information...
commit 023444424166ba2ce011bfe2d47954e79edf6798 1 parent 0b03c00
@bryckbost bryckbost authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  lib/delayed/syck_ext.rb
  2. +2 −2 spec/yaml_ext_spec.rb
View
2  lib/delayed/syck_ext.rb
@@ -2,7 +2,7 @@ class Module
yaml_as "tag:ruby.yaml.org,2002:module"
def self.yaml_new(klass, tag, val)
- klass
+ val.constantize
end
def to_yaml(options = {})
View
4 spec/yaml_ext_spec.rb
@@ -3,14 +3,14 @@
describe "YAML" do
it "should autoload classes" do
lambda {
- yaml = "--- !ruby/class:Autoloaded::Clazz {}\n"
+ yaml = "--- !ruby/class Autoloaded::Clazz\n"
YAML.load(yaml).should == Autoloaded::Clazz
}.should_not raise_error
end
it "should autoload the class of a struct" do
lambda {
- yaml = "--- !ruby/class:Autoloaded::Struct {}\n"
+ yaml = "--- !ruby/class Autoloaded::Struct\n"
YAML.load(yaml).should == Autoloaded::Struct
}.should_not raise_error
end

1 comment on commit 0234444

@asanghi

Looking good!! Worked for me!

Please sign in to comment.
Something went wrong with that request. Please try again.