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

Commit

Permalink
Removes join table row to fix foreign key violation on interest deletion
Browse files Browse the repository at this point in the history
fixes #220
  • Loading branch information
Richard Rodgers committed Jun 8, 2015
1 parent 7f8a9af commit deffd64
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/models/Subscriber.scala
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ case class Subscriber(id: Int, // DB key
}

def removeInterest(scheme: Scheme, intValue: String) = {
DB.withConnection { implicit c =>
SQL("delete from interest where subscriber_id = {subscriber_id} and scheme_tag = {scheme_tag} and int_value = {int_value}")
.on('subscriber_id -> id, 'scheme_tag -> scheme.tag, 'int_value -> intValue).executeUpdate()
}
interestWithValue(scheme.tag, intValue).map(i => Interest.delete(i.id))
}

def holdCount = {
Expand Down

0 comments on commit deffd64

Please sign in to comment.