Skip to content

Commit

Permalink
update flavors value int to float datatype (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj authored Aug 18, 2017
1 parent 8de28b6 commit 56b18ac
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion app/controllers/admin/Flavors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import play.api.mvc._
import controllers.stack.Results
import models.Constants.{FLAVORCLAZ, FLAVORCOLLECTIONCLAZ}


/**
* @author rajthilak
*
Expand Down
5 changes: 2 additions & 3 deletions app/models/admin/Flavors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ abstract class ConcreteFlavors extends FlavorSacks with RootConnector {
.and(_.properties setTo rip.properties)
.and(_.updated_at setTo DateHelper.now())
.future()

scala.concurrent.Await.result(res, 5.seconds).successNel
}

Expand All @@ -191,7 +191,6 @@ abstract class ConcreteFlavors extends FlavorSacks with RootConnector {
}
}


object Flavors extends ConcreteFlavors {

private def mkFlavorsSack(email: String, input: String): ValidationNel[Throwable, FlavorResult] = {
Expand All @@ -213,7 +212,7 @@ object Flavors extends ConcreteFlavors {
new ResourceItemNotFound("", "Flavor items = nothing found.")
}).toValidationNel.flatMap { nm: Seq[FlavorResult] =>
if (!nm.isEmpty) {
Validation.success[Throwable, Seq[FlavorResult]](nm.sortWith(_.cpu.toInt < _.cpu.toInt).sortWith(_.ram.toInt < _.ram.toInt).sortWith(_.disk.toInt < _.disk.toInt)).toValidationNel
Validation.success[Throwable, Seq[FlavorResult]](nm.sortWith(_.cpu.toFloat < _.cpu.toFloat).sortWith(_.ram.toFloat < _.ram.toFloat).sortWith(_.disk.toFloat < _.disk.toFloat)).toValidationNel

} else {
Validation.failure[Throwable, Seq[FlavorResult]](new ResourceItemNotFound("", "Flavor = nothing found.")).toValidationNel
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
play "com.websudos:phantom-testkit:1.16.0"
play "com.websudos:phantom-connectors:1.16.0"
play "com.typesafe.akka:akka-slf4j:2.4.1"
play "io.megam:libcommon_2.11:0.39"
play "io.megam:libcommon_2.11:1.9.3"
playTest "io.megam:newman_2.11:1.3.12"
playTest "org.specs2:specs2-core:3.7-scalaz-7.1.6"
playTest "org.specs2:specs2-matcher-extra:3.7-scalaz-7.1.6"
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ val phantomV = "1.25.4"

libraryDependencies ++= Seq(filters, cache,
"org.yaml" % "snakeyaml" % "1.17",
"io.megam" %% "libcommon" % "1.9.2",
"io.megam" %% "libcommon" % "1.9.3",
"io.megam" %% "newman" % "1.3.12",
"com.typesafe.akka" %% "akka-slf4j" % "2.4.16",
"com.websudos" %% "phantom-dsl" % phantomV,
Expand Down

0 comments on commit 56b18ac

Please sign in to comment.