lib/rails/mongoid.rb
# Create indexes for each model given the provided globs and the class is
# not embedded.
#
# @example Create all the indexes.
#   Rails::Mongoid.create_indexes
#
# @return [ Array<Class> ] The indexed models.
#
# @since 2.1.0
Create indexes for each model given the provided globs and the class is
not embedded.
Create indexes for each model given the provided globs and the class is not embedded .
def create_indexes
      ::Mongoid.models.each do |model|
        next if model.index_specifications.empty?
        unless model.embedded?
          model.create_indexes
          logger.info("MONGOID: Created indexes on #{model}:")
          model.index_specifications.each do |spec|
            logger.info("MONGOID: Index: #{spec.key}, Options: #{spec.options}")
          end
          model
        else
          logger.info("MONGOID: Index ignored on: #{model}, please define in the root model.")
          nil
        end
      end.compact
    end
def create_indexes :: Mongoid . models . each do | model | next if model . index_specifications . empty? unless model . embedded? model . create_indexes logger . info ( "MONGOID: Created indexes on #{model}:" ) model . index_specifications . each do | spec | logger . info ( "MONGOID: Index: #{spec.key}, Options: #{spec.options}" ) end model else logger . info ( "MONGOID: Index ignored on: #{model}, please define in the root model." ) nil end end . compact end
Create indexes for each model given the provided globs and the class is
not embedded.
Create indexes for each model given the provided globs and the class is not embedded .
The indexed models.
The indexed models .
 Array<Class> 
example
Create all the indexes. Rails::Mongoid.create_indexes
Create all the indexes . Rails :: Mongoid . create_indexes
since
None