Sha256: acecf7e701954f91f90a75f3cb553533c43a4705b9b228661c906eeb03fbb1f8
Contents?: true
Size: 467 Bytes
Versions: 48
Compression:
Stored size: 467 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Extensions #:nodoc: module Array #:nodoc: module Accessors #:nodoc: # If the attributes already exists in the array then they will be # updated, otherwise they will be appended. def update(attributes) delete_if { |e| attributes["_id"] && (e["_id"] == attributes["_id"]) } self.<< attributes end alias :merge! :update end end end end
Version data entries
48 entries across 48 versions & 7 rubygems