These are chat archives for dry-rb/chat
Next-gen ruby libs! » github.com/dry-rb » website: https://dry-rb.org » forum: https://discourse.dry-rb.org
@coop How’s this read?
(Technically, these examples are entities rather than strict value types, because we include the record IDs in their attributes, which you'd expect to be the key indicator of equality. However, in practice,
Dry::Types::Structinstances still check for equality across all attributes, and in our apps we only ever instantiate these objects from known-good database data, which means they still behave effectively as value objects. So let's continue!)
changed_article = article.with_title(“my new title”)and then pass
changed_articleto the DB.
validates :title, :presencetype syntax ?
(error messages, output hash) => activemodeland
(full type) => activemodel