Sha256: 6b3da2b02fa0575a4449861945f0c8619b21cae5941fdd7ae67973d5bdfa788b
Contents?: true
Size: 443 Bytes
Versions: 31
Compression:
Stored size: 443 Bytes
Contents
module Mongoid #:nodoc: module Extensions #:nodoc: module Hash #:nodoc: module Accessors #:nodoc: def insert(key, attrs) self[key] = attrs if key.singular? if key.plural? if elements = self[key] elements.delete_if { |e| (e[:_id] == attrs[:_id]) } << attrs else self[key] = [attrs] end end end end end end end
Version data entries
31 entries across 31 versions & 1 rubygems