count_by() and count_all() ignore the soft-delete status#84
Open
carlos-mora wants to merge 6 commits intojamierumbelow:masterfrom
Open
count_by() and count_all() ignore the soft-delete status#84carlos-mora wants to merge 6 commits intojamierumbelow:masterfrom
carlos-mora wants to merge 6 commits intojamierumbelow:masterfrom
Conversation
count_by and count_all() didn't take into account the soft-delete status in record counting. get_many_by() and get_all() does, so it looks better to follow the behavoir in the analogous method.
Not sure about this, ar's count_all operates independently of ar's status, the only way i found is to count_all_results().
syntax error!
Conflicts: core/MY_Model.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added the condition to adapt both method to be coherent with their counterparts get_many_by() and get_all().
I'm not sure if the count_all solution is the best, because it could be affected by previous where calls, but it is my best approach.