From 4b9aae074663f02aebe80189dfe8709a4c3860a5 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 2 Apr 2024 14:07:03 +0700 Subject: [PATCH] Add information about `subunit_numericality` --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a5ff20af5..b0945996b 100644 --- a/README.md +++ b/README.md @@ -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: