lib/sunspot_association/model.rb
def reindex_sunspot_associations!(event)
      return false unless self.class.sunspot_associate?

      self.class.sunspot_association_configuration.each do |object, config|
        case event
        when :create
          reindex_sunspot_association!(object) if config[:on_create]
        when :update
          reindex_sunspot_association!(object) if reindex_sunspot_association?(object)
        when :destroy
          reindex_sunspot_association!(object)
        end
      end
    end
# Main callback method, checks if it should reindex an association
Main callback method, checks if it should reindex an association
Main callback method checks if it should reindex an association
def reindex_sunspot_associations!(event)
      return false unless self.class.sunspot_associate?
      self.class.sunspot_association_configuration.each do |object, config|
        case event
        when :create
          reindex_sunspot_association!(object) if config[:on_create]
        when :update
          reindex_sunspot_association!(object) if reindex_sunspot_association?(object)
        when :destroy
          reindex_sunspot_association!(object)
        end
      end
    end
def reindex_sunspot_associations! ( event ) return false unless self . class . sunspot_associate? self . class . sunspot_association_configuration . each do | object , config | case event when :create reindex_sunspot_association! ( object ) if config [ :on_create ] when :update reindex_sunspot_association! ( object ) if reindex_sunspot_association? ( object ) when :destroy reindex_sunspot_association! ( object ) end end end
Main callback method, checks if it should reindex an association
Main callback method checks if it should reindex an association
event