Skip to content

Commit

Permalink
Merge pull request #74 from vdaviot/unset_hop
Browse files Browse the repository at this point in the history
[FIX] unsetting hop on host
  • Loading branch information
moul authored Nov 16, 2018
2 parents 61b7f72 + 9f06573 commit ecc004a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,9 @@ GLOBAL OPTIONS:
// remove the hop
if c.Bool("unset-hop") {
var hopHost Host

db.Model(&host).Related(&hopHost, "HopID")
if err := model.Association("Hop").Delete(hopHost).Error; err != nil {
if err := model.Association("Hop").Clear().Error; err != nil {
tx.Rollback()
return err
}
Expand Down

0 comments on commit ecc004a

Please sign in to comment.