class Delayed::PsychExt::YAMLTree

Public Instance Methods

accept(target) click to toggle source
Calls superclass method
# File lib/delayed/psych_ext.rb, line 30
def accept(target)
  if defined?(ActiveRecord::Base) && target.is_a?(ActiveRecord::Base)
    tag = ['!ruby/ActiveRecord', target.class.name].compact.join(':')
    map = @emitter.start_mapping(nil, tag, false, Psych::Nodes::Mapping::BLOCK)
    register(target, map)
    @emitter.scalar('attributes', nil, nil, true, false, Psych::Nodes::Mapping::ANY)
    accept target.attributes.slice(target.class.primary_key)

    @emitter.end_mapping
  else
    super
  end
end