-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: move score property into ParseQueryScorable #319
Conversation
Thanks for opening this pull request!
|
@pmmlo can you let me know what you think about this? |
You are a rockstar! Sorry to make more work. I honestly liked it the way you had it. But, if we’re embracing protocols, do you think it would make sense to move I’m on mobile but nothing I could see other than that. |
Not sure how to make this happen since sortByTextScore modifies the query and not the ParseObject. Do you have an idea on how to cary this out? I think it’s okay if sortByTextScore remains in query as essentially some can sort and never look at score. |
Codecov Report
@@ Coverage Diff @@
## main #319 +/- ##
==========================================
- Coverage 84.63% 84.61% -0.02%
==========================================
Files 114 114
Lines 11850 11850
==========================================
- Hits 10029 10027 -2
- Misses 1821 1823 +2
Continue to review full report at Codecov.
|
Thinking about this more, I may be able to add: public func sortByTextScore() -> Query<T> where T: ParseObject & ParseQueryScorable { but this will cause a breaking change to anyone who began using |
New Pull Request Checklist
Issue Description
Swift SDK 3.0.0 made all
ParseObjects
's have to have the propertyvar score: Double?
though this property is only needed when using thematchesText
QueryConstraint
.Related issue: #n/a
Approach
Move the
var score: Double?
to a protocol namedParseQueryScorable
. When developers want to sort by score using amatchesText
QueryConstraint
, they just conform theirParseObject
's toParseQueryScorable
. Looks like below:Developers who are not using the score property, but have upgraded can do either of the following:
ParseObject
's as it won't break your codeTODOs before merging