flash-gordon on or_nil-extension
flash-gordon on custom-builder-methods
flash-gordon on master
Support for custom builder meth… Merge pull request #415 from dr… (compare)
# system/boot/db.rb
Application.finalize(:db) do |container|
init do
require 'some/3rd/party/db'
container.register(:db, DB.configure(ENV['DB_URL']))
end
start do
db.establish_connection
end
stop do
db.close_connection
end
end
to_time = -> x { Time.iso8601("#{x}Z") }
ISOTime = Types::Strict::Time.constructor(to_time)
Schema = Dry::Validation.JSON do
optional(:sent_at, :time).value(ISOTime)
...
optional(:sent_at) { time? | value(ISOTime) }
?
I've found that, at least in my specific case,
each do
schema do
#some schema here
end
end
is not equivalent to
FunSchema = Dry::Validation.Schema do
# some schema here
end
# ... another schema
each do
schema(FunSchema)
end