Closed juampi92 closed 3 years ago
It appears that the tests are failing with the message Invalid Application-ID or API key
.
Is there anything else I should do?
Thank you for the PR @juampi92 ! Don't worry about the failing tests for now, there's currently an issue with the credentials for forked PRs. I'll dig into and review your PR later today or tomorrow morning!
This is released in v1.19.0. Thank you again for contributing!
What problem is this fixing?
The
UpdateJob
class has a little trick that checks if the model has atoSearchableArray
implementation, and if it doesn't, it will apply a generic transformation.Given that every searchable model has to implement Laravel Scout's Searchable trait, the check logic had to be wrapped around that. A simple
method_exists
wouldn't cut it.To solve this, this package was making sure that the definition of the method
toSearchableArray
was the actual model's class.. . .
The problem with this implementation comes when you want to group behavior inside a trait (especially for big models). At Studocu we usually do this, and it took us a while to notice that the method
toSearchableArray
inside ourDocumentSearchable
trait for the Document model was being wrapped with an extra transformer.Describe your change
To add support for custom Traits (or even class inheritance), I changed the way we check if the
toSearchableArray
method is defined.Instead of checking that the method's definition is in the Model class, we're now checking that the method's definition doesn't come from the Scout/Searchable trait.