Skip to content

Commit

Permalink
Adding model comment (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
paganotoni authored and stanislas-m committed Dec 1, 2019
1 parent 2a2287e commit fa6cc2d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
1 change: 1 addition & 0 deletions genny/model/_fixtures/models/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/gofrs/uuid"
)

// Widget is used by pop to map your widgets database table to your go code.
type Widget struct {
ID uuid.UUID `json:"id" db:"id"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
Expand Down
1 change: 1 addition & 0 deletions genny/model/_fixtures/models/widget_empty.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/gobuffalo/validate"
)

// Widget is used by pop to map your widgets database table to your go code.
type Widget struct {
}

Expand Down
1 change: 1 addition & 0 deletions genny/model/_fixtures/models/widget_jsonapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/google/jsonapi"
)

// Widget is used by pop to map your widgets database table to your go code.
type Widget struct {
ID uuid.UUID `jsonapi:"primary,id" db:"id"`
CreatedAt time.Time `jsonapi:"attr,created_at" db:"created_at"`
Expand Down
1 change: 1 addition & 0 deletions genny/model/_fixtures/models/widget_xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/gofrs/uuid"
)

// Widget is used by pop to map your widgets database table to your go code.
type Widget struct {
ID uuid.UUID `xml:"id" db:"id"`
CreatedAt time.Time `xml:"created_at" db:"created_at"`
Expand Down
2 changes: 1 addition & 1 deletion genny/model/templates/-path-/-name-.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/gobuffalo/validate/validators"
{{- end }}
)

// {{.model.Name.Proper}} is used by pop to map your {{.model.Name.Proper.Pluralize.Underscore}} database table to your go code.
{{- if eq $.model.Encoding.String "jsonapi"}}
type {{.model.Name.Proper}} struct {
{{- range $a := .opts.Attrs }}
Expand Down

0 comments on commit fa6cc2d

Please sign in to comment.