Sha256: 70d820d1532b0b027359210d53492ff08c3d6910491cd16e711e14154a492bc8

Contents?: true

Size: 653 Bytes

Versions: 27

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

module Mongoid
  module Contextual
    module Queryable

      # @attribute [r] collection The collection to query against.
      # @attribute [r] criteria The criteria for the context.
      # @attribute [r] klass The klass for the criteria.
      attr_reader :collection, :criteria, :klass

      # Is the enumerable of matching documents empty?
      #
      # @example Is the context empty?
      #   context.blank?
      #
      # @return [ true, false ] If the context is empty.
      #
      # @since 3.0.0
      def blank?
        !exists?
      end
      alias :empty? :blank?
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
mongoid-7.3.5 lib/mongoid/contextual/queryable.rb
mongoid-7.3.4 lib/mongoid/contextual/queryable.rb
mongoid-7.1.11 lib/mongoid/contextual/queryable.rb
mongoid-7.2.6 lib/mongoid/contextual/queryable.rb
mongoid-7.3.3 lib/mongoid/contextual/queryable.rb
mongoid-7.3.2 lib/mongoid/contextual/queryable.rb
mongoid-7.2.5 lib/mongoid/contextual/queryable.rb
mongoid-7.1.10 lib/mongoid/contextual/queryable.rb
mongoid-7.1.9 lib/mongoid/contextual/queryable.rb
mongoid-7.2.4 lib/mongoid/contextual/queryable.rb
mongoid-7.3.1 lib/mongoid/contextual/queryable.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/lib/mongoid/contextual/queryable.rb
mongoid-7.3.0 lib/mongoid/contextual/queryable.rb
mongoid-7.2.3 lib/mongoid/contextual/queryable.rb
mongoid-7.1.8 lib/mongoid/contextual/queryable.rb
mongoid-7.2.2 lib/mongoid/contextual/queryable.rb
mongoid-7.2.1 lib/mongoid/contextual/queryable.rb
mongoid-7.1.7 lib/mongoid/contextual/queryable.rb
mongoid-7.2.0 lib/mongoid/contextual/queryable.rb
mongoid-7.1.6 lib/mongoid/contextual/queryable.rb