Class: ActiveRecord::Base

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

Direct Known Subclasses

Delayed::Job

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.yaml_new(klass, _tag, val) ⇒ Object



6
7
8
9
10
11
# 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



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

def to_yaml_properties
  ['@attributes']
end