Skip to content
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

Merged
merged 3 commits into from Aug 2, 2018
Merged

make bool2Fox always explicit #2989

merged 3 commits into from Aug 2, 2018

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Jul 31, 2018

URL of deployed dev instance (used for testing):

Steps to test:

  • create/edit project
  • create task, trace some, finish
  • view compound project

Issues:


@@ -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
Copy link
Contributor

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?

Copy link
Member Author

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.
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

@rschwanhold rschwanhold left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jstriebel jstriebel left a comment

Choose a reason for hiding this comment

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

❤️

@fm3 fm3 merged commit d3cf104 into master Aug 2, 2018
@fm3 fm3 deleted the booltofox-explicit branch August 2, 2018 09:37
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.

remove implicit Boolean to Fox conversion
3 participants