Skip to content

Conversation

@ADmad
Copy link
Member

@ADmad ADmad commented Mar 16, 2024

Refs #17610

I'll add more tests for code coverage once the PR is approved in principle.

@ADmad ADmad added this to the 5.1.0 milestone Mar 16, 2024
@othercorey
Copy link
Member

othercorey commented Mar 20, 2024

The change looks reasonable, but I don't know much about the use cases.

@ADmad ADmad requested a review from markstory March 21, 2024 02:06
Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Requiring rules to have names in order to use remove methods on them is a good approach .

Comment on lines +207 to +208
$rules->remove('ruleName');
$this->assertTrue($rules->check($entity, RulesChecker::CREATE));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have tests for the other remove* methods as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

markstory added a commit to cakephp/docs that referenced this pull request Apr 1, 2024
@markstory markstory merged commit dde2648 into 5.next Apr 1, 2024
@markstory markstory deleted the 5.1-rules-checker-remove branch April 1, 2024 15:09
ADmad added a commit to cakephp/docs that referenced this pull request Apr 1, 2024
ADmad added a commit to ADmad/cakephp that referenced this pull request Aug 10, 2025
Rules added using the `add()` method should not apply for delete operations.
Closes cakephp#18800
dereuromark added a commit that referenced this pull request Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants