Skip to content

Commit a976b7c

Browse files
author
rafay-qayyum
committed
Fixed Dup on ES Aggregations
1 parent 0b92c86 commit a976b7c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Response
2222
class Aggregations < HashWrapper
2323
disable_warnings if respond_to?(:disable_warnings)
2424

25-
def initialize(attributes={})
25+
def initialize(attributes={}, options= {})
2626
__redefine_enumerable_methods super(attributes)
2727
end
2828

elasticsearch-model/spec/elasticsearch/model/response/aggregations_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,11 @@ def self.index_name; 'foo'; end
8080
expect(aggregations.price.max.value).to eq(99)
8181
end
8282
end
83+
84+
describe '#dup' do
85+
86+
it 'creates a copy of the aggregation' do
87+
expect(aggregations.dup).to eq(aggregations)
88+
end
89+
end
8390
end

0 commit comments

Comments
 (0)