Module: Mongoid::Extensions::Symbol

Defined in:
build/mongoid-7.3/lib/mongoid/extensions/symbol.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#mongoid_id?true, false

Is the symbol a valid value for a Mongoid id?

Examples:

Is the string an id value?

:_id.mongoid_id?

Returns:

  • (true, false)

    If the symbol is :id or :_id.

Since:

  • 2.3.1



16
17
18
# File 'build/mongoid-7.3/lib/mongoid/extensions/symbol.rb', line 16

def mongoid_id?
  to_s.mongoid_id?
end