2022-05-20 07:13:09 +08:00
|
|
|
* Support infinite ranges for `LengthValidator`s `:in`/`:within` options
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
validates_length_of :first_name, in: ..30
|
|
|
|
```
|
|
|
|
|
|
|
|
*fatkodima*
|
|
|
|
|
2022-05-18 12:57:15 +08:00
|
|
|
* Add support for beginless ranges to inclusivity/exclusivity validators:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
validates_inclusion_of :birth_date, in: -> { (..Date.today) }
|
|
|
|
```
|
|
|
|
|
|
|
|
*Bo Jeanes*
|
|
|
|
|
2022-05-18 01:46:00 +08:00
|
|
|
* Make validators 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 }
|
|
|
|
```
|
|
|
|
|
|
|
|
*fatkodima*
|
|
|
|
|
2022-05-03 00:59:50 +08:00
|
|
|
* Fix casting long strings to `Date`, `Time` or `DateTime`
|
|
|
|
|
|
|
|
*fatkodima*
|
|
|
|
|
2022-02-03 16:17:03 +08:00
|
|
|
* Use different cache namespace for proxy calls
|
2021-11-17 03:56:30 +08:00
|
|
|
|
2022-02-03 16:17:03 +08:00
|
|
|
Models can currently have different attribute bodies for the same method
|
|
|
|
names, leading to conflicts. Adding a new namespace `:active_model_proxy`
|
|
|
|
fixes the issue.
|
|
|
|
|
|
|
|
*Chris Salzberg*
|
2021-11-17 03:56:30 +08:00
|
|
|
|
2021-12-07 23:52:30 +08:00
|
|
|
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/activemodel/CHANGELOG.md) for previous changes.
|