Sha256: 21e8c57e63b2429611109a0a345046b9561410f95602205c36281a5ab2ab85da

Contents?: true

Size: 268 Bytes

Versions: 61

Compression:

Stored size: 268 Bytes

Contents

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

61 entries across 61 versions & 8 rubygems

Version Path
pwnash-mongo_mapper-0.7.5 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-0.7.6 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-0.7.5 lib/mongo_mapper/plugins/clone.rb
mongo_mapper_ign-0.7.4 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-0.7.4 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-0.7.3 lib/mongo_mapper/plugins/clone.rb
numon-0.0.1 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-0.7.2 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-0.7.1 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.3.8 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.3.5 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.3.4 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.3.3 lib/mongo_mapper/plugins/clone.rb
drogus-mongo_mapper-0.6.10 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.2.28 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.2.27 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.2.26 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.2.25 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.2.24 lib/mongo_mapper/plugins/clone.rb
mongo_mapper-unstable-2010.2.23 lib/mongo_mapper/plugins/clone.rb