Skip to content

Commit 4b9aae0

Browse files
authored
Add information about subunit_numericality
1 parent 72c3773 commit 4b9aae0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ to the validation you are willing to skip, like this:
189189
monetize :price_in_a_range_cents, numericality: false
190190
```
191191

192+
And you can also use `subunit_numericality` for subunit:
193+
194+
```ruby
195+
monetize :price_in_a_range_cents,
196+
allow_nil: true,
197+
subunit_numericality: {
198+
greater_than_or_equal_to: 0,
199+
less_than_or_equal_to: 100_00
200+
}
201+
```
202+
192203
### Mongoid 2.x and 3.x
193204

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

0 commit comments

Comments
 (0)