Skip to content

Commit

Permalink
[skip ci] ActiveModel notable changes added to 7.1 release note
Browse files Browse the repository at this point in the history
[skip ci] review changes updated
  • Loading branch information
akhilgkrishnan committed Sep 1, 2023
1 parent e4350f6 commit 369be4a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions guides/source/7_1_release_notes.md
Expand Up @@ -491,6 +491,31 @@ Please refer to the [Changelog][active-model] for detailed changes.

### Notable changes

* Add support for infinite ranges to `LengthValidator`s `:in`/`:within` options.

```ruby
validates_length_of :first_name, in: ..30
```

* Add support for beginless ranges to `inclusivity/exclusivity` validators.

```ruby
validates_inclusion_of :birth_date, in: -> { (..Date.today) }
```

* Add support for password challenges to `has_secure_password`. When set, validate that the password
challenge matches the persisted `password_digest`.

* Allow validators to accept lambdas without record argument.

```ruby
# Before
validates_comparison_of :birth_date, less_than_or_equal_to: ->(_record) { Date.today }

# After
validates_comparison_of :birth_date, less_than_or_equal_to: -> { Date.today }
```

Active Support
--------------

Expand Down

0 comments on commit 369be4a

Please sign in to comment.