Created
October 2, 2013 08:42
-
-
Save wshino/6790797 to your computer and use it in GitHub Desktop.
This file contains 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
def create(createdAt: DateTime = DateTime.now)( | |
implicit session: AsyncDBSession = AsyncDB.sharedSession, cxt: EC = ECGlobal): Future[Log] = { | |
for { | |
id <- withSQL { | |
insert.into(Log).namedValues(column.createdAt -> createdAt) | |
}.updateAndReturnGeneratedKey.future() | |
} yield Log(id = id, createdAt = createdAt) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment