Sha256: 23eb77ad4d9b94cd78a3c91b706b0551d675b1e01deb6d3997252e9b589342d0
Contents?: true
Size: 560 Bytes
Versions: 43
Compression:
Stored size: 560 Bytes
Contents
module Mongoid module Matcher # @api private module Or module_function def matches?(document, expr) unless expr.is_a?(Array) raise Errors::InvalidQuery, "$or argument must be an array: #{Errors::InvalidQuery.truncate_expr(expr)}" end if expr.empty? raise Errors::InvalidQuery, "$or argument must be a non-empty array: #{Errors::InvalidQuery.truncate_expr(expr)}" end expr.any? do |sub_expr| Expression.matches?(document, sub_expr) end end end end end
Version data entries
43 entries across 43 versions & 1 rubygems