From aa962deec037375a7cfae3b96094becdfe48e778 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Wed, 4 Oct 2017 21:43:04 -0700 Subject: Replace deprecated Id method with ID (#2655) --- models/release.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'models/release.go') diff --git a/models/release.go b/models/release.go index 0909b7b3be..ddaf6d6aa1 100644 --- a/models/release.go +++ b/models/release.go @@ -170,7 +170,7 @@ func addReleaseAttachments(releaseID int64, attachmentUUIDs []string) (err error for i := range attachments { attachments[i].ReleaseID = releaseID // No assign value could be 0, so ignore AllCols(). - if _, err = x.Id(attachments[i].ID).Update(attachments[i]); err != nil { + if _, err = x.ID(attachments[i].ID).Update(attachments[i]); err != nil { return fmt.Errorf("update attachment [%d]: %v", attachments[i].ID, err) } } @@ -220,7 +220,7 @@ func GetRelease(repoID int64, tagName string) (*Release, error) { func GetReleaseByID(id int64) (*Release, error) { rel := new(Release) has, err := x. - Id(id). + ID(id). Get(rel) if err != nil { return nil, err @@ -365,7 +365,7 @@ func UpdateRelease(gitRepo *git.Repository, rel *Release, attachmentUUIDs []stri } rel.LowerTagName = strings.ToLower(rel.TagName) - _, err = x.Id(rel.ID).AllCols().Update(rel) + _, err = x.ID(rel.ID).AllCols().Update(rel) if err != nil { return err } @@ -402,7 +402,7 @@ func DeleteReleaseByID(id int64, u *User, delTag bool) error { return fmt.Errorf("git tag -d: %v - %s", err, stderr) } - if _, err = x.Id(rel.ID).Delete(new(Release)); err != nil { + if _, err = x.ID(rel.ID).Delete(new(Release)); err != nil { return fmt.Errorf("Delete: %v", err) } } else { @@ -412,7 +412,7 @@ func DeleteReleaseByID(id int64, u *User, delTag bool) error { rel.Title = "" rel.Note = "" - if _, err = x.Id(rel.ID).AllCols().Update(rel); err != nil { + if _, err = x.ID(rel.ID).AllCols().Update(rel); err != nil { return fmt.Errorf("Update: %v", err) } } -- cgit v1.2.3