Sha256: 8794b3d84a5b00d43b4bb3767e39c4c6b045521f2231b0df50caa55a2e44686e
Contents?: true
Size: 521 Bytes
Versions: 11
Compression:
Stored size: 521 Bytes
Contents
if defined?(ActiveRecord) module ActiveRecord class Base yaml_tag '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
Version data entries
11 entries across 11 versions & 1 rubygems