elasticsearch-rails

https://github.com/elastic/elasticsearch-rails

Ruby

Elasticsearch integrations for ActiveModel/Record and Ruby on Rails

Elasticsearch::Model::Response::Aggregations#__redefine_enumerable_methods

Fix the problem of Hashie::Mash returning unexpected values for `min` and `max` methods

People can define names for aggregations such as `min` and `max`, but these
methods are defined in `Enumerable#min` and `Enumerable#max`

    { foo: 'bar' }.min
    # => [:foo, "bar"]

Therefore, any Hashie::Mash instance value has the `min` and `max`
methods redefined to return the real value

Source | Google | Stack overflow

Edit

git clone [email protected]:elastic/elasticsearch-rails.git

cd elasticsearch-rails

open elasticsearch-model/lib/elasticsearch/model/response/aggregations.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Elasticsearch--Model--Response--Aggregations-__redefine_enumerable_methods-for-pr


# Commit to git

git add elasticsearch-model/lib/elasticsearch/model/response/aggregations.rbgit commit -m "better docs for Elasticsearch::Model::Response::Aggregations#__redefine_enumerable_methods"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Elasticsearch--Model--Response--Aggregations-__redefine_enumerable_methods-for-pr

hub pull-request


# Celebrate!