Skip to content

Commit d3981d1

Browse files
Merge pull request rails#49103 from akhilgkrishnan/activemodel-notable-release-note
[skip ci] ActiveModel notable changes added to 7.1 release note
2 parents d51fa84 + 369be4a commit d3981d1

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
@@ -515,6 +515,31 @@ Please refer to the [Changelog][active-model] for detailed changes.
515515

516516
### Notable changes
517517

518+
* Add support for infinite ranges to `LengthValidator`s `:in`/`:within` options.
519+
520+
```ruby
521+
validates_length_of :first_name, in: ..30
522+
```
523+
524+
* Add support for beginless ranges to `inclusivity/exclusivity` validators.
525+
526+
```ruby
527+
validates_inclusion_of :birth_date, in: -> { (..Date.today) }
528+
```
529+
530+
* Add support for password challenges to `has_secure_password`. When set, validate that the password
531+
challenge matches the persisted `password_digest`.
532+
533+
* Allow validators to accept lambdas without record argument.
534+
535+
```ruby
536+
# Before
537+
validates_comparison_of :birth_date, less_than_or_equal_to: ->(_record) { Date.today }
538+
539+
# After
540+
validates_comparison_of :birth_date, less_than_or_equal_to: -> { Date.today }
541+
```
542+
518543
Active Support
519544
--------------
520545

0 commit comments

Comments
 (0)