You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library has some logic where, if your indexing is conditioned on a particular attribute, the library will figure out if that attribute value has changed, and add/delete the object in algolia appropriately. However, I had some code like this, and this functionality wasn't working:
algoliasearch:if=>:active?do# ...end
After digging through the library, I realized it wasn't working because of this code:
If you mistakenly pass do :if => :active? instead of :if => :active, this line will check for a method called active?_changed?, which obviously doesn't exist. It would be great if this library should automatically handle predicate methods that are aliases for attribute methods.
Happy to contribute a PR to add this functionality.
The text was updated successfully, but these errors were encountered:
Description
This library has some logic where, if your indexing is conditioned on a particular attribute, the library will figure out if that attribute value has changed, and add/delete the object in algolia appropriately. However, I had some code like this, and this functionality wasn't working:
After digging through the library, I realized it wasn't working because of this code:
algoliasearch-rails/lib/algoliasearch-rails.rb
Line 934 in 360e47d
If you mistakenly pass do
:if => :active?
instead of:if => :active
, this line will check for a method calledactive?_changed?
, which obviously doesn't exist. It would be great if this library should automatically handle predicate methods that are aliases for attribute methods.Happy to contribute a PR to add this functionality.
The text was updated successfully, but these errors were encountered: