Skip to content

Commit bd546fa

Browse files
martinstreicherpicandocodigo
authored andcommitted
Ensure subclasses are added to the registry
1 parent 98b6ce0 commit bd546fa

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

elasticsearch-model/lib/elasticsearch/model.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ class << self
112112
METHODS.each do |method|
113113
delegate method, to: :__elasticsearch__ unless self.public_instance_methods.include?(method)
114114
end
115+
116+
def inherited(subclass)
117+
super
118+
Registry.add(subclass) if subclass.is_a?(Class)
119+
end
115120
end
116121
end
117122

0 commit comments

Comments
 (0)