lib/maglev/active_job/enhanced_serialize.rb
# special loader for loading destroyed models
special loader for loading destroyed models
special loader for loading destroyed models
def deserialize_destroyed(arg)
            klass = arg['class'].constantize
            attributes = JSON.load(arg['value'])
            if klass.respond_to?(:deserialize_destroyed)
              klass.load_destroyed(attributes)
            else
              klass.new(attributes).tap do |instance|
                instance.instance_variable_set('@destroyed', true)
              end
            end
          end
def deserialize_destroyed ( arg ) klass = arg [ 'class' ] . constantize attributes = JSON . load ( arg [ 'value' ] ) if klass . respond_to? ( :deserialize_destroyed ) klass . load_destroyed ( attributes ) else klass . new ( attributes ) . tap do | instance | instance . instance_variable_set ( '@destroyed' , true ) end end end
special loader for loading destroyed models
special loader for loading destroyed models
# if the class has its own load method # otherwise use a basic implementation
arg
<not_specific>