These are chat archives for dry-rb/chat

23rd
Apr 2018
Pavel Argentov
@argent-smith
Apr 23 2018 15:23
Hi ppl. How to package a Klass::ActiveRecord_Associations_CollectionProxy into a dry-struct (via dry-types)?
Specifically, I want to declare a certain model's scope as a struct member
Nikita Shilnikov
@flash-gordon
Apr 23 2018 17:09
@argent-smith you can use Types::Any in comlex cases
Pavel Argentov
@argent-smith
Apr 23 2018 17:12
thnx
I've tried Types.Definition() as well: it works
Nikita Shilnikov
@flash-gordon
Apr 23 2018 17:14
hm, yeah, though Definition doesn't do a type check actually, .Instance() does, or its alias, .Strict()
Jonah
@jonahx
Apr 23 2018 19:13
@solnic @timriley friendly poke re: question above ^^
Also separate question for today: I have an Dry::Struct with an attribute with a Class type constraint. When using rspec, I want to pass in a double for the object. But an rspec double does not have type class. Have you ever run into this? What was your workaround?