meilisearch / meilisearch-rails

Meilisearch integration for Ruby on Rails
https://www.meilisearch.com
MIT License
295 stars 48 forks source link

Inaccurate console warning #366

Open jeremylynch opened 2 months ago

jeremylynch commented 2 months ago

We are declaring nested attributes like this:

attribute :user do
  {
    first_name: contact&.first_name,
    last_name: contact&.last_name
  }
end

searchable_attributes [
  'user.first_name'
]

However we are getting these warning:

[meilisearch-rails] Team#user.first_name declared in searchable_attributes but not in attributes. Please add it to attributes if it should be searchable.

Clearly we have declared this as a (nested) attribute - Fortunately the search still works as intended, this seems to have no impact on functionality.

Is this console warning a bug?

brunoocasali commented 2 months ago

Hi @jeremylynch yeah I guess this is indeed a bug in the warning section, thanks for reporting and I'm glad the search is working :)