mongoid/mongoid_fulltext

Mongoid Edge/6 and Mongo v2 driver compatibility

Startouf opened this issue · 0 comments

It seems mongoid_fulltext is no longer compatible with the most recent mongoid version. Problem come from Mongo v2 Driver which no longer provides a remove_all interface.
Might want to follow the track of https://github.com/DatabaseCleaner/database_cleaner/issues/378

NoMethodError: undefined method `remove_all' for #<Mongo::Collection::View:0x0000000acd5a28>
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongoid_fulltext-0.7.1/lib/mongoid/full_text_search.rb:334:in `block in update_ngram_index'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongoid_fulltext-0.7.1/lib/mongoid/full_text_search.rb:319:in `each_pair'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongoid_fulltext-0.7.1/lib/mongoid/full_text_search.rb:319:in `update_ngram_index'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/bundler/gems/mongoid-7c2ff52a0c52/lib/mongoid/contextual/mongo.rb:687:in `yield_document'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/bundler/gems/mongoid-7c2ff52a0c52/lib/mongoid/contextual/mongo.rb:124:in `block in each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongo-2.2.5/lib/mongo/collection/view/iterable.rb:45:in `block in each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongo-2.2.5/lib/mongo/cursor.rb:85:in `block in each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongo-2.2.5/lib/mongo/cursor.rb:85:in `each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongo-2.2.5/lib/mongo/cursor.rb:85:in `each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongo-2.2.5/lib/mongo/collection/view/iterable.rb:44:in `each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/bundler/gems/mongoid-7c2ff52a0c52/lib/mongoid/query_cache.rb:208:in `each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/bundler/gems/mongoid-7c2ff52a0c52/lib/mongoid/contextual/mongo.rb:123:in `each'
        from C:in `each'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mongoid_fulltext-0.7.1/lib/mongoid/full_text_search.rb:294:in `update_ngram_index'
        from (irb):1
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/console.rb:65:in `start'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/console_helper.rb:9:in `start'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/commands_tasks.rb:78:in `console'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
        from C:/Dev/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc1/lib/rails/commands.rb:18:in `<top (required)>'