Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fetch attribute values for excluded models #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 26, 2019

  1. Do not fetch attribute values for excluded models

    Upon upgrading from 1.20 => 1.22 we noticed errors due to changes around
    handling excluded records. This PR implements a fix by only fetching
    attribute names when determining if an index operation is necessary and
    adds a test to ensure that our use case will not break. Example model
    
    ```rb
    class Example < ActiveRecord::Base
      include AlgoliaSearch
    
      algoliasearch :unless => :nil_name do
        attribute :name_length do
          # will crash if name is nil
          name.length
        end
      end
    
      def nil_name
        name.nil?
      end
    end
    ```
    Gasparila committed Apr 26, 2019
    Configuration menu
    Copy the full SHA
    fbcec89 View commit details
    Browse the repository at this point in the history