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
make bool2Fox always explicit #2989
Conversation
@@ -408,8 +408,8 @@ class Authentication @Inject()( | |||
|
|||
private def creatingOrganizationsIsAllowed(requestingUser: Option[User]) = { | |||
val noOrganizationPresent = InitialDataService.assertNoOrganizationsPresent | |||
val configurationFlagSet = Play.configuration.getBoolean("application.allowOrganzationCreation").getOrElse(false) ?~> "allowOrganzationCreation.notEnabled" | |||
val userIsSuperUser = requestingUser.exists(_.isSuperUser).toFox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct that .toFox
and bool2Fox
have the same behavior? The only difference is that Boolean does not have a method called .toFox
thats why it is implicitly converted to a Fox and then returns itself, while bool2Fox
converts it explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.toFox
is actually a method of Fox. This way, if called on any type that has an implicit conversion to Fox, that conversion will be triggered. This will now no longer work for booleans (as is intended).
@@ -42,6 +38,11 @@ trait FoxImplicits { | |||
|
|||
implicit def fox2FutureBox[T](f: Fox[T])(implicit ec: ExecutionContext): Future[Box[T]] = | |||
f.futureBox | |||
|
|||
// This one is no longer implicit since that has lead to confusion. Should always be used explicitly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it wanted that it still belongs to FoxImplicits
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that way it is available to all the classes inheriting from that Trait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
[ ] Updated changelog[ ] Updated migration guide if applicable