Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
18 lines (15 sloc) 0.506 kb
if defined?(ActiveRecord)
module ActiveRecord
class Base
yaml_as 'tag:ruby.yaml.org,2002:ActiveRecord'
def self.yaml_new(klass, _tag, val)
klass.unscoped.find(val['attributes'][klass.primary_key])
rescue ActiveRecord::RecordNotFound
raise Delayed::DeserializationError, "ActiveRecord::RecordNotFound, class: #{klass} , primary key: #{val['attributes'][klass.primary_key]}"
end
def to_yaml_properties
['@attributes']
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.