Skip to content

Commit

Permalink
Add a comment on Create to describe Flat and Eager modes
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislas-m committed Feb 24, 2019
1 parent 4321166 commit 9878145
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func (c *Connection) ValidateAndCreate(model interface{}, excludeColumns ...stri

// Create add a new given entry to the database, excluding the given columns.
// It updates `created_at` and `updated_at` columns automatically.
//
// Create support two modes:
// * Flat (default): Associate existing nested objects only. NO creation or update of nested objects.
// * Eager: Associate existing nested objects and create non-existent objects. NO change to existing objects.
func (c *Connection) Create(model interface{}, excludeColumns ...string) error {
var isEager = c.eager

Expand Down

0 comments on commit 9878145

Please sign in to comment.