This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package models | |
| import externals.BCrypt | |
| import play.db.anorm._; | |
| class User (protected var _id: Int, protected var _email: String, protected var _name: String, | |
| protected var _password: String, protected var _permissions: Set[String]) extends ActiveModel { | |
| private val BCRYPT_WORK_FACTOR: Int = 6 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case object transaction { | |
| import java.sql.Connection | |
| def apply[T](query: => T):Option[T] = { | |
| val conn:Connection = play.db.DB.getConnection | |
| val auto:Boolean = conn.getAutoCommit | |
| try { | |
| conn.setAutoCommit(false) | |
| Some(query) | |
| } catch { |
NewerOlder