These are chat archives for dry-rb/chat

24th
Feb 2016
Fran Worley
@fran-worley
Feb 24 2016 16:35

@solnic in this example:

key(:issue_date) { |value| value.filled? & value.lteq?(Date.today) }

The date is being set when the class is loaded rather than when the schema is run. Am I able to pass a lambda in here or is there a better way of achieving this?

Piotr Solnica
@solnic
Feb 24 2016 16:35
@fran-worley custom predicate today?
a general best practice is to not pollute schema defs with dynamic info
Fran Worley
@fran-worley
Feb 24 2016 16:37
@solnic Yup that would do it thanks. How are you feeling now? Sorry to hear you were unwell
Piotr Solnica
@solnic
Feb 24 2016 16:38
still sick but slowly getting better, thanks
Fran Worley
@fran-worley
Feb 24 2016 16:44
well I wish you all the best and thanks for your help :smile:
Piotr Solnica
@solnic
Feb 24 2016 16:44
thank you :)