Sha256: 863a39fad1b098601f98278a8676e87df28a7ccaa148eef9a487c6fc489559db
Contents?: true
Size: 507 Bytes
Versions: 14
Compression:
Stored size: 507 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
14 entries across 14 versions & 1 rubygems