Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #147 from MITLibraries/137_resmap_swordUrl_nullable
Browse files Browse the repository at this point in the history
Allows SWORD Url to be optional
  • Loading branch information
Richard Rodgers committed Mar 31, 2015
2 parents 7f6d2c6 + 4879fca commit 718de61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/ContentProfile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case class ContentProfile(id: Int, tag: String, label: String, description: Stri
if (! schemes.contains(scheme)) {
DB.withConnection { implicit c =>
SQL("insert into content_profile_scheme (content_profile_id, scheme_id) values ({cprof_id}, {scheme_id})")
.on('cprof_id -> id, 'scheme_id -> scheme.id).executeInsert()
.on('cprof_id -> id, 'scheme_id -> scheme.id).executeUpdate()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/models/ResourceMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ case class ResourceMap(id: Int, tag: String, description: String, swordUrl: Opti
object ResourceMap {

val resmap = {
get[Int]("id") ~ get[String]("tag") ~ get[String]("description") ~ get[String]("sword_url") map {
case id ~ tag ~ description ~ swordUrl => ResourceMap(id, tag, description, Some(swordUrl))
get[Int]("id") ~ get[String]("tag") ~ get[String]("description") ~ get[Option[String]]("sword_url") map {
case id ~ tag ~ description ~ swordUrl => ResourceMap(id, tag, description, swordUrl)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/ResourceMapSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ResourceMapSpec extends Specification {
ResourceMap.create("tag", "desc", None)
ResourceMap.all.size must equalTo(1)
}
}.pendingUntilFixed("See https://github.com/MITLibraries/scoap3hub/issues/137")
}

"#make" in {
running(FakeApplication(additionalConfiguration = inMemoryDatabase())) {
Expand Down

0 comments on commit 718de61

Please sign in to comment.