Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play 2.5.x Anorm Doc update with DI #129

Merged
merged 2 commits into from Oct 19, 2016

Conversation

Projects
None yet
3 participants
@abhisheknoldus
Copy link
Contributor

commented Oct 13, 2016

Pull Request Checklist

Fixes

Fixes #6620
This PR is related Issue #6620 raised in Play framework. Here is the link :
playframework/playframework#6620

Purpose

What does this PR do?
This PR update the scala Anorm documentation for play 2.5.x. In Play 2.5.x Database trait is there instead of DB object. So, This PR specify using Database trait members with the help of DI.

Background Context

Why did you take this approach?

References

Are there any relevant issues / PRs / mailing lists discussions?
playframework/playframework#6620

import anorm._
import com.google.inject.Inject
//#playdb
class ScalaAnorm @Inject () (db: Database) {

This comment has been minimized.

Copy link
@wsargent

wsargent Oct 19, 2016

Member

the imports should be available within the preview snippet

"Anorm" should {
"be usable in play" in new WithApplication(FakeApplication(additionalConfiguration = inMemoryDatabase())) {
//#playdb
import anorm._

This comment has been minimized.

Copy link
@wsargent

wsargent Oct 19, 2016

Member

Included imports

@abhisheknoldus

This comment has been minimized.

Copy link
Contributor Author

commented Oct 19, 2016

@wsargent requested changes has been done. Please check.

@wsargent wsargent merged commit 52fba8e into playframework:master Oct 19, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
typesafe-cla-validator All users have signed the CLA
Details

@abhisheknoldus abhisheknoldus changed the title play 2.5.x Anorm Doc update with using DI play 2.5.x Anorm Doc update with DI Oct 20, 2016

@majidhosseini1

This comment has been minimized.

Copy link

commented Jul 10, 2017

The document explaining how to use Anorm still does not mention the fact that play.api.db.DB has been deprecated (https://github.com/playframework/anorm/blob/master/docs/manual/working/scalaGuide/main/sql/ScalaAnorm.md)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.