Validation always does a count query #284

merged 2 commits into from Jan 20, 2012

2 participants


The validation process does for every record a count query to check if the record exists. This is regarding the use of the 'on' => ['create'|'update'] validation functionality. However this isn't always needed; only when the 'on' key is actually used. Which you won't be using all the time.

This pull request optimizes this validation process where the 'on' key isn't used.

Not sure if this is taken care of in 2.0, but I can imagine you'd like to port it.


P.S. The error/fail the model validation test cases gives was already there. I checked with @Ceeram.

@markstory markstory merged commit 27392bf into cakephp:1.3 Jan 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment