Sha256: b3263ab2225f76f3bc04b3c03f3ae2ca785af4f1da2669aabc1875eb4b5730a2
Contents?: true
Size: 485 Bytes
Versions: 15
Compression:
Stored size: 485 Bytes
Contents
require 'set' module MongoMapper module Plugins module Dumpable DUMP_BLACKLIST = Set.new([:@errors]) def marshal_dump instance_variables.map(&:to_sym).inject({}) do |h, var| h[var] = instance_variable_get(var) unless DUMP_BLACKLIST.include?(var) or var.to_s.start_with?("@__") h end end def marshal_load(data) data.each do |k, v| instance_variable_set(k, v) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems