Sha256: 7d50fca47d5bae283cdbe685dc630db7d218a83e9e8ff7f46c1b57c867c7e9f8

Contents?: true

Size: 286 Bytes

Versions: 3

Compression:

Stored size: 286 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  module Plugins
    module Clone
      module InstanceMethods
        def clone
          clone_attributes = self.attributes
          clone_attributes.delete("_id")
          self.class.new(clone_attributes)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
mongo_mapper_ign-0.7.7 lib/mongo_mapper/plugins/clone.rb
pwnash-mongo_mapper-0.7.6 lib/mongo_mapper/plugins/clone.rb
mongo_mapper_ign-0.7.6 lib/mongo_mapper/plugins/clone.rb