Actions
Bug #34141
closedThe validate_presence and validate_readable with predicate broken
Description
When using the following code in modern Ruby, it starts to fail:
validate_presence :setting, if: ->(settings) { false }
This causes the if: part to be interpreted as a setting to validate, rather than as a predicate for :setting.
I reproduced this on Smart Proxy 3.2.0-develop with Ruby 3. It looks like there's no test coverage for this use case.
Updated by The Foreman Bot about 3 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ewoud Kohl van Wijngaarden
- Pull request https://github.com/theforeman/smart-proxy/pull/806 added
Updated by Ewoud Kohl van Wijngaarden about 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 01b39acde45a27d0b25912c2e0d449f772a59745.
Updated by Amit Upadhye over 2 years ago
- Subject changed from validate_presence and validate_readable with predicate broken to The validate_presence and validate_readable with predicate broken
Actions