Sha256: 0ae4b838f9f8dbe312e08672e89b884a1838b9378992fe34f231343cab1a5401
Contents?: true
Size: 506 Bytes
Versions: 10
Compression:
Stored size: 506 Bytes
Contents
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
Version data entries
10 entries across 10 versions & 3 rubygems