Skip to content

Commit

Permalink
scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nemoo committed Mar 8, 2024
1 parent edba315 commit 2418e6c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions app/models/Project.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ class ProjectRepo @Inject()(taskRepo: TaskRepo)(protected val dbConfigProvider:
def id = column[Long]("id", O.AutoInc, O.PrimaryKey)
def name = column[String]("name")

def * = (id, name) <> (Project.tupled, Project.unapply)
def ? = (id.?, name.?).shaped.<>({ r => import r._; _1.map(_ => Project.tupled((_1.get, _2.get))) }, (_: Any) => throw new Exception("Inserting into ? projection not supported."))
def * = (id, name) <> ((Project.apply _).tupled, Project.unapply)

}
}
5 changes: 2 additions & 3 deletions app/models/Task.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TaskRepo @Inject()(protected val dbConfigProvider: DatabaseConfigProvider)
import dbConfig.profile.api._
private[models] val Tasks = TableQuery[TasksTable]

implicit val taskStatusColumnType = MappedColumnType.base[TaskStatus.Value, String](
implicit val taskStatusColumnType: BaseColumnType[TaskStatus.Value] = MappedColumnType.base[TaskStatus.Value, String](
_.toString, string => TaskStatus.withName(string))

def findById(id: Long): Future[Task] =
Expand Down Expand Up @@ -73,8 +73,7 @@ class TaskRepo @Inject()(protected val dbConfigProvider: DatabaseConfigProvider)
def status = column[TaskStatus.Value]("status")
def project = column[Long]("project")

def * = (id, color, status, project) <> (Task.tupled, Task.unapply)
def ? = (id.?, color.?, status.?, project.?).shaped.<>({ r => import r._; _1.map(_ => Task.tupled((_1.get, _2.get, _3.get, _4.get))) }, (_: Any) => throw new Exception("Inserting into ? projection not supported."))
def * = (id, color, status, project) <> ((Task.apply _).tupled, Task.unapply)
}

}
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.13.12"
scalaVersion := "3.3.3"

routesGenerator := InjectedRoutesGenerator

Expand All @@ -30,7 +30,6 @@ libraryDependencies += "org.playframework.silhouette" %% "play-silhouette-passwo
libraryDependencies += "org.playframework.silhouette" %% "play-silhouette-persistence" % "10.0.0"
libraryDependencies += "org.playframework.silhouette" %% "play-silhouette-crypto-jca" % "10.0.0"
libraryDependencies += "net.codingwell" %% "scala-guice" % "6.0.0"
libraryDependencies += "com.iheart" %% "ficus" % "1.4.7"

ThisBuild / libraryDependencySchemes ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
Expand Down

0 comments on commit 2418e6c

Please sign in to comment.