LoginSignup
6
6

More than 5 years have passed since last update.

play console で model の動作などを確認したい場合

Posted at

play.core.StaticApplication を new すると良い様です

参照:
https://groups.google.com/d/msg/play-framework/EFYnWC1yYsg/30TGLEQ-q68J

$ play console                                                                         
[info] Loading project definition from /private/tmp/todolist/project
[info] Set current project to todolist (in build file:/private/tmp/todolist/)
[info] Starting scala interpreter...
[info] 
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_35).
Type in expressions to have them evaluated.
Type :help for more information.

scala> new play.core.StaticApplication(new java.io.File("."))
[info] play - database [default] connected at jdbc:postgresql://localhost:5432/todolist
[info] play - Application started (Prod)
res0: play.core.StaticApplication = play.core.StaticApplication@4cdd09a6

scala> models.Task.all()
res1: List[models.Task] = List(Task(1,Complete the tutorial))

scala> 

6
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6