Sha256: e2fcc3ce591d4b69136d41a11f2659fd1463992e4951ee73910b542f3ea0cb2f
Contents?: true
Size: 482 Bytes
Versions: 52
Compression:
Stored size: 482 Bytes
Contents
# encoding: UTF-8 module MongoMapper module Plugins module Clone module InstanceMethods def initialize_copy(other) @_new = true @_destroyed = false default_id_value({}) self.attributes = other.attributes.clone.except(:_id).inject({}) do |hash, entry| key, value = entry hash[key] = value.duplicable? ? value.clone : value hash end end end end end end
Version data entries
52 entries across 52 versions & 3 rubygems