lib/alba.rb in alba-3.0.2 vs lib/alba.rb in alba-3.0.3

- old
+ new

@@ -112,14 +112,17 @@ # @return [Class<Alba::Resource>] resource class def infer_resource_class(name, nesting: nil) raise Alba::Error, 'Inference is disabled so Alba cannot infer resource name. Set inflector before use.' unless Alba.inflector const_parent = nesting.nil? ? Object : Object.const_get(nesting) + # rubocop-performance 1.20.2 might resolve this + # rubocop:disable Performance/StringIdentifierArgument begin const_parent.const_get("#{inflector.classify(name)}Resource") rescue NameError # Retry for serializer const_parent.const_get("#{inflector.classify(name)}Serializer") end + # rubocop:enable Performance/StringIdentifierArgument end # Configure Alba to symbolize keys def symbolize_keys! @symbolize_keys = true