Skip to content

Commit f104d3d

Browse files
martinstreicherpicandocodigo
authored andcommitted
Ensure subclasses are added to the registry
1 parent 8ebd78d commit f104d3d

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

Diff for: elasticsearch-model/lib/elasticsearch/model.rb

+5
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ class << self
114114
METHODS.each do |method|
115115
delegate method, to: :__elasticsearch__ unless self.public_instance_methods.include?(method)
116116
end
117+
118+
def inherited(subclass)
119+
super
120+
Registry.add(subclass) if subclass.is_a?(Class)
121+
end
117122
end
118123
end
119124

0 commit comments

Comments
 (0)