File tree Expand file tree Collapse file tree 1 file changed +3
-21
lines changed
Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change 1515module Meilisearch
1616end
1717
18+ # Softly deprecate the old spelling of the top level module
19+ # from MeiliSearch to Meilisearch
1820module MeiliSearch
1921 class << self
20- # Softly deprecate the old spelling of the top level module
21- # from MeiliSearch to Meilisearch
2222 def const_missing ( const_name )
23- return super if @warned && @constants_defined
24-
2523 _warn_about_deprecation
26- _define_constants
2724
28- # Now that all the proper constants have been set,
29- # we can tell ruby to search for the const in MeiliSearch again.
30- # If it's still not found, then it does not exist in
31- # Meilisearch and the call to `super` will throw a normal error
32- const_get ( const_name )
25+ Meilisearch . const_get ( const_name )
3326 end
3427
3528 def method_missing ( method_name , *args , **kwargs )
3629 _warn_about_deprecation
37- _define_constants
3830
3931 Meilisearch . send ( method_name , *args , **kwargs )
4032 end
@@ -55,15 +47,5 @@ def _warn_about_deprecation
5547
5648 @warned = true
5749 end
58-
59- def _define_constants
60- return if @constants_defined
61-
62- Meilisearch . constants . each do |constant |
63- const_set ( constant , Meilisearch . const_get ( constant ) )
64- end
65-
66- @constants_defined = true
67- end
6850 end
6951end
You can’t perform that action at this time.
0 commit comments