mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Move Implicit && to model package object.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package object model {
|
package object model {
|
||||||
import scala.slick.lifted.MappedTypeMapper
|
import scala.slick.driver.BasicDriver.Implicit._
|
||||||
|
import scala.slick.lifted.{Column, MappedTypeMapper}
|
||||||
|
|
||||||
// java.util.Date TypeMapper
|
// java.util.Date TypeMapper
|
||||||
implicit val dateTypeMapper = MappedTypeMapper.base[java.util.Date, java.sql.Timestamp](
|
implicit val dateTypeMapper = MappedTypeMapper.base[java.util.Date, java.sql.Timestamp](
|
||||||
@@ -7,6 +8,10 @@ package object model {
|
|||||||
t => new java.util.Date(t.getTime)
|
t => new java.util.Date(t.getTime)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
implicit class RichColumn(c1: Column[Boolean]){
|
||||||
|
def &&(c2: => Column[Boolean], guard: => Boolean): Column[Boolean] = if(guard) c1 && c2 else c1
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns system date.
|
* Returns system date.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import scala.slick.jdbc.{StaticQuery => Q}
|
|||||||
import Q.interpolation
|
import Q.interpolation
|
||||||
|
|
||||||
import model._
|
import model._
|
||||||
import util.StringUtil._
|
|
||||||
import util.Implicits._
|
|
||||||
|
|
||||||
trait IssuesService {
|
trait IssuesService {
|
||||||
import IssuesService._
|
import IssuesService._
|
||||||
@@ -241,6 +239,7 @@ trait IssuesService {
|
|||||||
|
|
||||||
object IssuesService {
|
object IssuesService {
|
||||||
import javax.servlet.http.HttpServletRequest
|
import javax.servlet.http.HttpServletRequest
|
||||||
|
import util.StringUtil._
|
||||||
|
|
||||||
val IssueLimit = 30
|
val IssueLimit = 30
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
import scala.slick.driver.H2Driver.simple._
|
|
||||||
import scala.util.matching.Regex
|
import scala.util.matching.Regex
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,11 +24,6 @@ object Implicits {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Should this implicit conversion move to model.Functions?
|
|
||||||
implicit class RichColumn(c1: Column[Boolean]){
|
|
||||||
def &&(c2: => Column[Boolean], guard: => Boolean): Column[Boolean] = if(guard) c1 && c2 else c1
|
|
||||||
}
|
|
||||||
|
|
||||||
implicit class RichString(value: String){
|
implicit class RichString(value: String){
|
||||||
def replaceBy(regex: Regex)(replace: Regex.MatchData => Option[String]): String = {
|
def replaceBy(regex: Regex)(replace: Regex.MatchData => Option[String]): String = {
|
||||||
val sb = new StringBuilder()
|
val sb = new StringBuilder()
|
||||||
|
|||||||
Reference in New Issue
Block a user