Skip to content

Commit da73695

Browse files
committed
[MODEL] Added MyModel#index_name and MyModel#document_type getter/setter on the instance level
1 parent 4c760ab commit da73695

File tree

1 file changed

+10
-0
lines changed
  • elasticsearch-model/lib/elasticsearch/model

1 file changed

+10
-0
lines changed

elasticsearch-model/lib/elasticsearch/model/naming.rb

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ def document_type name=nil
2020

2121
end
2222

23+
module InstanceMethods
24+
def index_name name=nil
25+
@index_name = name || @index_name || self.class.index_name
26+
end
27+
28+
def document_type name=nil
29+
@document_type = name || @document_type || self.class.document_type
30+
end
31+
end
32+
2333
end
2434
end
2535
end

0 commit comments

Comments
 (0)