Skip to content

Commit

Permalink
[ngorm] add godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Apr 13, 2017
1 parent 0b5cedd commit 3ce4c09
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions association.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ func (a *Association) Find(v interface{}) error {
return a.db.Related(v, a.column)
}

// Append append new associations for many2many, has_many, replace current association for has_one, belongs_to
// Append append new associations for many2many, has_many, replace current
// association for has_one, belongs_to
//
// This wraps around Association.Save, verbatim meaning you can have the same
// effect with Save method.
func (a *Association) Append(values ...interface{}) error {
return a.Save(values...)
}

// Save save passed values as associations
// Save save passed values as associations. This expects to have a single value
// for a has_one, belongs_to relationships. You can pass one or more values for
// many_to_many relationship.
func (a *Association) Save(values ...interface{}) error {
if len(values) > 0 {
e := a.db.e
Expand Down

0 comments on commit 3ce4c09

Please sign in to comment.