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

+ (Object) yaml_new(klass, tag, val)



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

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

- (Object) to_yaml_properties



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

def to_yaml_properties
  ['@attributes']
end