Closed
Description
Description
this builds on #250 BUT if we fix that issue ... we run into the next one
condition_key = meilisearch_options[:type].primary_key if has_virtual_column_as_pk
calls the primary_key
method on the model. Mongoid doesn't have a primary_key
method and it seem to be doing anything with the fact that I've added the following to my model. It should be calling my ms_id
method but it's hardcoded to call primary_key
meilisearch primary_key: :ms_id
this may actually be an issue that extends beyond mongoid, but i can't test that at the moment.
Expected behavior
call the primary key method i told it to.
Current behavior
it called .primary_key
which is a non-existent method.
Task.find('foo')
/Users/masukomi/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/meilisearch-rails-0.9.0/lib/meilisearch-rails.rb:650:in `ms_search': undefined method `primary_key' for Task:Class (NoMethodError)
condition_key = meilisearch_options[:type].primary_key if has_virtual_column_as_pk
Environment (please complete the following information):
- OS: [macOS]
- Meilisearch server version: [e.g. v.1.1.1] (irrelevant though)
- meilisearch-rails version: [e.g v0.9.0]
- Rails version: [e.g. 7.0.4.3]