lib/mongoid/criteria/queryable/mergeable.rb in mongoid-7.0.5 vs lib/mongoid/criteria/queryable/mergeable.rb in mongoid-7.0.6

- old
+ new

@@ -43,20 +43,21 @@ # @since 1.0.0 def union use(:__union__) end - # Reset the stratgies to nil, used after cloning. + # Clear the current strategy and negating flag, used after cloning. # # @example Reset the strategies. # mergeable.reset_strategies! # # @return [ nil ] nil. # # @since 1.0.0 def reset_strategies! - self.strategy, self.negating = nil, nil + self.strategy = nil + self.negating = nil end private # Adds the criterion to the existing selection. @@ -165,11 +166,11 @@ # @api private # # @example Add the criterion. # mergeable.__override__([ 1, 2 ], "$in") # - # @param [ Hash ] criterion The criteria. + # @param [ Hash | Criteria ] criterion The criteria. # @param [ String ] operator The MongoDB operator. # # @return [ Mergeable ] The new mergeable. # # @since 1.0.0 @@ -223,10 +224,10 @@ # Add criterion to the selection with the named strategy. # # @api private # # @example Add criterion with a strategy. - # mergeable.with_strategy(:__union__, [ 1, 2, 3 ], "$in") + # mergeable.with_strategy(:__union__, {field_name: [ 1, 2, 3 ]}, "$in") # # @param [ Symbol ] strategy The name of the strategy method. # @param [ Object ] criterion The criterion to add. # @param [ String ] operator The MongoDB operator. #