Sha256: efaac57113299c21ca3073b4b52ebdb7b0b5986e493b775bd405350f8c214d2f
Contents?: true
Size: 470 Bytes
Versions: 7
Compression:
Stored size: 470 Bytes
Contents
if defined?(ActiveRecord) class ActiveRecord::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
Version data entries
7 entries across 7 versions & 1 rubygems