These are chat archives for dry-rb/chat

17th
Jun 2018
Ryan Bigg
@radar
Jun 17 2018 06:47
What is the alternative to constructor_type :schema now to allow an attribute key to be missing by default?
Oh I think I saw it above: transform_types { |t| t.meta(omittable: true) }
Nope, that's not it...
https://github.com/radar/exploding-rails-examples/tree/0ec2eaed049e7fb7542ba1117b71b83c78cee345 <- Here's my code. It's the ticketee project. It has a failing test like this:
``` Failure/Error: @project = Projects::Project.new
 Dry::Struct::Error:
   [Projects::Project.new] :id is missing in Hash input```
I'm out of time for that today, but I'll revisit this tomorrow morning. Thanks in advance for your help.
Nikita Shilnikov
@flash-gordon
Jun 17 2018 08:13
@radar on mobile, check out dry-struct’s changelog, type transformation should work
Ryan Bigg
@radar
Jun 17 2018 22:55
@flash-gordon It appears that the transform_types setting is not recognised by subclasses. I am calling transform_types within a class called ApplicationModel, but then relying on it in a class called Project that inherits from ApplicationModel. Is this the intended behaviour?
Oops, I wasn't calling it on klass within the inherited block. That'll do it.
Tim Riley
@timriley
Jun 17 2018 22:58
klassic radar
Ryan Bigg
@radar
Jun 17 2018 22:58
klassic.
good morning @timriley. Nice job on https://timriley.info/ :)
Tim Riley
@timriley
Jun 17 2018 22:59
hah, thank you :) It is built on dry-system and dry-view, so I suppose it is appropriate for this room!