Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information about subunit_numericality to README #695

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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