Sha256: ad6e00beff1da320aa4f854501c4fdec57935bd561d5b5b5dd52a1c7e02eca23

Contents?: true

Size: 291 Bytes

Versions: 5

Compression:

Stored size: 291 Bytes

Contents

class ActiveRecord::Base
  yaml_as "tag:ruby.yaml.org,2002:ActiveRecord"

  def self.yaml_new(klass, tag, val)
    klass.find(val['attributes']['id'])
  rescue ActiveRecord::RecordNotFound
    raise Delayed::DeserializationError
  end

  def to_yaml_properties
    ['@attributes']
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
delayed_job_hooked-2.1.5 lib/delayed/serialization/active_record.rb
delayed_job-2.1.4 lib/delayed/serialization/active_record.rb
delayed_job-2.1.3 lib/delayed/serialization/active_record.rb
delayed_job-2.1.2 lib/delayed/serialization/active_record.rb
delayed_job-2.1.1 lib/delayed/serialization/active_record.rb