File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ module Grape
6
6
# should subclass this class in order to build an API.
7
7
class API
8
8
# Class methods that we want to call on the API rather than on the API object
9
- NON_OVERRIDABLE = %I[ define_singleton_method instance_variable_set inspect class is_a? ! kind_of? respond_to? const_defined? const_missing ] . freeze
9
+ NON_OVERRIDABLE = %I[ define_singleton_method instance_variable_set inspect class is_a? ! kind_of?
10
+ respond_to? const_defined? const_missing parent parent_name name equal? to_s parents ] . freeze
10
11
11
12
class << self
12
13
attr_accessor :base_instance , :instances
@@ -48,7 +49,9 @@ def api.inherited(child_api)
48
49
# Alleviates problems with autoloading by tring to search for the constant
49
50
def const_missing ( *args )
50
51
if base_instance . const_defined? ( *args )
51
- base_instance . const_missing ( *args )
52
+ base_instance . const_get ( *args )
53
+ elsif parent && parent . const_defined? ( *args )
54
+ parent . const_get ( *args )
52
55
else
53
56
super
54
57
end
You can’t perform that action at this time.
0 commit comments