Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/delayed/serialization/active_record.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.yaml_new(klass, _tag, val) ⇒ Object



6
7
8
9
10
# File 'lib/delayed/serialization/active_record.rb', line 6

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

Instance Method Details

#to_yaml_propertiesObject



12
13
14
# File 'lib/delayed/serialization/active_record.rb', line 12

def to_yaml_properties
  ['@attributes']
end