Project

General

Profile

Actions

Bug #34141

closed

The validate_presence and validate_readable with predicate broken

Added by Ewoud Kohl van Wijngaarden over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Plugins
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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.

Actions #1

Updated by The Foreman Bot over 2 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
Actions #2

Updated by The Foreman Bot over 2 years ago

  • Fixed in Releases 3.2.0 added
Actions #3

Updated by Ewoud Kohl van Wijngaarden over 2 years ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Amit Upadhye almost 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

Also available in: Atom PDF