From 5618560337105167a373a7ce638e4443386c4334 Mon Sep 17 00:00:00 2001 From: Kyle Barton Date: Tue, 26 Mar 2019 10:36:05 +0200 Subject: [PATCH] Update DryTypes to 0.15 Change Dry::Types::Definition to Nominal to satisfy deprecation warning. The deprecation was added as part of https://github.com/dry-rb/dry-types/blob/master/CHANGELOG.md#0150-2019-03-22 --- graphiti.gemspec | 2 +- lib/graphiti/types.rb | 2 +- spec/filtering_spec.rb | 2 +- spec/persistence_spec.rb | 2 +- spec/serialization_spec.rb | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/graphiti.gemspec b/graphiti.gemspec index 233c8617..5b374b72 100644 --- a/graphiti.gemspec +++ b/graphiti.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = "~> 2.3" spec.add_dependency "jsonapi-serializable", "~> 0.3.0" - spec.add_dependency "dry-types", "~> 0.13" + spec.add_dependency "dry-types", "~> 0.15" spec.add_dependency "graphiti_errors", "~> 1.0.beta.1" spec.add_dependency "concurrent-ruby", "~> 1.0" spec.add_dependency "activesupport", [">= 4.1", "< 6"] diff --git a/lib/graphiti/types.rb b/lib/graphiti/types.rb index d38481be..54898d21 100644 --- a/lib/graphiti/types.rb +++ b/lib/graphiti/types.rb @@ -1,7 +1,7 @@ module Graphiti class Types def self.create(primitive, &blk) - definition = Dry::Types::Definition.new(primitive) + definition = Dry::Types::Nominal.new(primitive) definition.constructor(&blk) end diff --git a/spec/filtering_spec.rb b/spec/filtering_spec.rb index 9e0d02a4..fb121289 100644 --- a/spec/filtering_spec.rb +++ b/spec/filtering_spec.rb @@ -1072,7 +1072,7 @@ def assert_filter_value(value) context "when custom type" do before do - type = Dry::Types::Definition + type = Dry::Types::Nominal .new(nil) .constructor { |input| "custom!" diff --git a/spec/persistence_spec.rb b/spec/persistence_spec.rb index 1feba9d7..92e771f2 100644 --- a/spec/persistence_spec.rb +++ b/spec/persistence_spec.rb @@ -2102,7 +2102,7 @@ def save(value) context "when custom type" do before do - type = Dry::Types::Definition + type = Dry::Types::Nominal .new(nil) .constructor { |input| "custom!" diff --git a/spec/serialization_spec.rb b/spec/serialization_spec.rb index 7af5ee85..319c8e2c 100644 --- a/spec/serialization_spec.rb +++ b/spec/serialization_spec.rb @@ -47,7 +47,7 @@ def self.name context "when id is custom type" do before do - type = Dry::Types::Definition.new(String).constructor { |input| + type = Dry::Types::Nominal.new(String).constructor { |input| "custom!" } Graphiti::Types[:custom] = { @@ -555,7 +555,7 @@ def my_method context "when custom type" do before do - type = Dry::Types::Definition + type = Dry::Types::Nominal .new(nil) .constructor { |input| "custom!"