artsy/mongoid_fulltext

View on GitHub
lib/mongoid/full_text_search/indexes.rb

Summary

Maintainability
A
0 mins
Test Coverage
# hook onto model index creation to create related FT indexes
module Mongoid
  module Indexes
    module ClassMethods
      alias create_fulltext_indexes_hook create_indexes

      def create_indexes
        create_fulltext_indexes if respond_to?(:create_fulltext_indexes)
        create_fulltext_indexes_hook
      end
    end
  end
end