Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dogweather authored May 2, 2024
1 parent dd4d5cd commit 6c2e02a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class ImmutableDog < ValidatedObject::Base
end
```

And again, that `ImmutableDog` consists of one line of plain Ruby and two lines of standard Rails validations.

### `attr_reader` followed by `validates` is such a common pattern that there's a second DSL which wraps them up into one call: `validates_attr`.

Here's the immutable version of `Dog` re-written with the new, simplified DSL:
Expand Down

0 comments on commit 6c2e02a

Please sign in to comment.