• Mark Chao's avatar
    ES: Fix monkey patch not loaded · e2c68140
    Mark Chao authored
    GemExtensions::Elasticsearch::Model::Indexing::InstanceMethods is no
    longer prepended to the proxies, thus the project’s _id is
    incorrectly being set as “1” instead of “project_1". This means
    joining would fail.
    
    In the past, in config/initializers/elastic_client_setup.rb:
    
    1. ES::Model::Indexing::InstanceMethods is included in
    ES::Model::Proxy::InstanceMethodsProxy
    
    2. Our monkey-patch is then prepended to
    Elasticsearch::Model::Indexing::InstanceMethods
    
    Since prepending happens later, our monkey patch would not be part of
    ES::Model::Proxy::InstanceMethodsProxy's ancestor.
    
    However it did work, by luck, because ES::Git::Model would
    later include ES::Model, which would trigger the second
    `include` call, and in turn add prepend modules into the ancestors.
    
    But in previous commit, Elasticsearch::Git::Model is removed,
    therefore the monkey patch was no longer included.
    e2c68140
elastic_client_setup.rb 1.92 KB