def set_elasticsearchable_models
      # inspired by http://goo.gl/RJk2yK
      dir = File.expand_path('../../buweb',  __FILE__)
      Dir.glob(File.join("#{dir}/*.rb")).each do |path|
        model_filename = File.basename(path, ".rb") # Example: "academic_program"

        begin
          klass = Kernel.const_get model_filename.classify
        rescue NameError
          # Not sure this really needs to throw an error or if it should just keep going
          require(path) ? retry : raise(RuntimeError, "Cannot load class '#{klass}' from filename: '#{model_filename}'")
        end

        next unless klass.respond_to?(:__elasticsearch__)
        @elasticsearchable_models << klass
        @_models_have_been_set = true
      end
    end
def set_elasticsearchable_models
      # inspired by http://goo.gl/RJk2yK
      dir = File.expand_path('../../buweb',  __FILE__)
      Dir.glob(File.join("#{dir}/*.rb")).each do |path|
        model_filename = File.basename(path, ".rb") # Example: "academic_program"

        begin
          klass = Kernel.const_get model_filename.classify
        rescue NameError
          # Not sure this really needs to throw an error or if it should just keep going
          require(path) ? retry : raise(RuntimeError, "Cannot load class '#{klass}' from filename: '#{model_filename}'")
        end

        next unless klass.respond_to?(:__elasticsearch__)
        @elasticsearchable_models << klass
        @_models_have_been_set = true
      end
    end
Deprecated: this is no longer in use as we are defining the models manually