Skip to content

Commit a102c92

Browse files
committed
[MODEL] Call Hashie.disable_warnings method in Response wrappers
Adding to change introduced in 5732fa3, this patch disables the warnings Hashie prints out when a key clashing with a built-in method is being added. Related: elastic#666
1 parent 5732fa3 commit a102c92

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module Model
33
module Response
44

55
class Aggregations < Hashie::Mash
6+
disable_warnings if respond_to?(:disable_warnings)
7+
68
def initialize(attributes={})
79
__redefine_enumerable_methods super(attributes)
810
end

elasticsearch-model/lib/elasticsearch/model/response/suggestions.rb

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module Model
33
module Response
44

55
class Suggestions < Hashie::Mash
6+
disable_warnings if respond_to?(:disable_warnings)
7+
68
def terms
79
self.to_a.map { |k,v| v.first['options'] }.flatten.map {|v| v['text']}.uniq
810
end

0 commit comments

Comments
 (0)