From 0422d686af4a1e9ea1a5c9d0870304bca6cf0704 Mon Sep 17 00:00:00 2001 From: Maxime Raverdy Date: Fri, 12 Jun 2020 10:58:17 +0200 Subject: [PATCH] Fix code --- lib/grape-swagger/entity/helper.rb | 2 +- spec/spec_helper.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/grape-swagger/entity/helper.rb b/lib/grape-swagger/entity/helper.rb index 0a01b49..f88ece0 100644 --- a/lib/grape-swagger/entity/helper.rb +++ b/lib/grape-swagger/entity/helper.rb @@ -13,7 +13,7 @@ def model_name(entity_model, endpoint) def discriminator(entity_model) entity_model.superclass.root_exposures.detect do |value| - value.documentation.try(:[], :is_discriminator) + value.documentation.dig(:is_discriminator) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c9bc034..f8d6b10 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,7 +7,6 @@ require 'rack' require 'rack/test' -require 'pry' RSpec.configure do |config| require 'rspec/expectations'