Skip to content

Commit

Permalink
Merge pull request #483 from davidakachaos/fix_yaml_error
Browse files Browse the repository at this point in the history
Fixes a adjustedment made to the YAML part of Ruby
  • Loading branch information
sferik committed May 31, 2013
2 parents cde95f3 + f3e5de7 commit 80ad1f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/delayed/backend/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ def payload_object=(object)
end

def payload_object
@payload_object ||= YAML.load(self.handler)
if YAML.respond_to?(:unsafe_load)
#See https://github.com/dtao/safe_yaml
#When the method is there, we need to load our YAML like this...
@payload_object ||= YAML.load(self.handler, :safe => false)
else
@payload_object ||= YAML.load(self.handler)
end
rescue TypeError, LoadError, NameError, ArgumentError => e
raise DeserializationError,
"Job failed to load: #{e.message}. Handler: #{handler.inspect}"
Expand Down

0 comments on commit 80ad1f0

Please sign in to comment.