Files
adamantium/app/validation/posts/bookmark_contract.rb
2023-01-27 22:55:09 +11:00

18 lines
496 B
Ruby

module Adamantium
module Validation
module Posts
class BookmarkContract < Dry::Validation::Contract
params do
required(:name).filled(:string)
required(:content).maybe(:string)
required(:category).array(:string)
required(:published_at).maybe(:time)
required(:url).filled(:string)
required(:slug).filled(:string)
required(:post_type).value(included_in?: %w[bookmark])
end
end
end
end
end