Skip to content

Commit 369be4a

Browse files
[skip ci] ActiveModel notable changes added to 7.1 release note
[skip ci] review changes updated
1 parent e4350f6 commit 369be4a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

guides/source/7_1_release_notes.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,31 @@ Please refer to the [Changelog][active-model] for detailed changes.
491491

492492
### Notable changes
493493

494+
* Add support for infinite ranges to `LengthValidator`s `:in`/`:within` options.
495+
496+
```ruby
497+
validates_length_of :first_name, in: ..30
498+
```
499+
500+
* Add support for beginless ranges to `inclusivity/exclusivity` validators.
501+
502+
```ruby
503+
validates_inclusion_of :birth_date, in: -> { (..Date.today) }
504+
```
505+
506+
* Add support for password challenges to `has_secure_password`. When set, validate that the password
507+
challenge matches the persisted `password_digest`.
508+
509+
* Allow validators to accept lambdas without record argument.
510+
511+
```ruby
512+
# Before
513+
validates_comparison_of :birth_date, less_than_or_equal_to: ->(_record) { Date.today }
514+
515+
# After
516+
validates_comparison_of :birth_date, less_than_or_equal_to: -> { Date.today }
517+
```
518+
494519
Active Support
495520
--------------
496521

0 commit comments

Comments
 (0)