Skip to content

Commit

Permalink
Add information about subunit_numericality
Browse files Browse the repository at this point in the history
  • Loading branch information
afuno authored Apr 2, 2024
1 parent 72c3773 commit 4b9aae0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ to the validation you are willing to skip, like this:
monetize :price_in_a_range_cents, numericality: false
```

And you can also use `subunit_numericality` for subunit:

```ruby
monetize :price_in_a_range_cents,
allow_nil: true,
subunit_numericality: {
greater_than_or_equal_to: 0,
less_than_or_equal_to: 100_00
}
```

### Mongoid 2.x and 3.x

`Money` is available as a field type to supply during a field definition:
Expand Down

0 comments on commit 4b9aae0

Please sign in to comment.