Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix type check
It should have been `is_a?`, not `<`
  • Loading branch information
flash-gordon committed Aug 1, 2019
1 parent 39b1ca3 commit 0c90f9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions lib/dry/types/hash.rb
Expand Up @@ -121,13 +121,8 @@ def build_keys(type_map)
# @api private
def resolve_type(type)
case type
when ::Class
if type < Type
type
else
Types[type]
end
when ::String then Types[type]
when Type then type
when ::Class, ::String then Types[type]
else type
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dry/types/schema_spec.rb
Expand Up @@ -293,7 +293,7 @@ def self.to_ary

it 'uses type even if it is a class with a registered name' do
bool = Class.new do
include(Dry::Types::Type)
extend Dry::Types::Type

def self.meta
{}
Expand Down

0 comments on commit 0c90f9d

Please sign in to comment.