mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: change receivers to static one (#4355)
* entc/gen: change receivers to static one * entc/integration: codegen * examples: codegen * chore: fixed spacing
This commit is contained in:
@@ -100,15 +100,15 @@ type predicateAdder interface {
|
||||
}
|
||||
|
||||
{{- if not $n.IsView }}
|
||||
// addPredicate implements the predicateAdder interface.
|
||||
func (m *{{ $mutation }}) addPredicate(pred func(s *sql.Selector)) {
|
||||
m.predicates = append(m.predicates, pred)
|
||||
}
|
||||
// addPredicate implements the predicateAdder interface.
|
||||
func (m *{{ $mutation }}) addPredicate(pred func(s *sql.Selector)) {
|
||||
m.predicates = append(m.predicates, pred)
|
||||
}
|
||||
|
||||
// Filter returns an entql.Where implementation to apply filters on the {{ $mutation }} builder.
|
||||
func (m *{{ $mutation }}) Filter() *{{ $filter }} {
|
||||
return &{{ $filter }}{config: m.config, predicateAdder: m}
|
||||
}
|
||||
// Filter returns an entql.Where implementation to apply filters on the {{ $mutation }} builder.
|
||||
func (m *{{ $mutation }}) Filter() *{{ $filter }} {
|
||||
return &{{ $filter }}{config: m.config, predicateAdder: m}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
// {{ $filter }} provides a generic filtering capability at runtime for {{ $builder }}.
|
||||
|
||||
@@ -208,9 +208,9 @@ func NewSchemaConfigContext(parent context.Context, config SchemaConfig) context
|
||||
{{- range $n := $.Nodes }}
|
||||
{{ $n.Name }}: tableSchemas[{{ indexOf $all $n.TableSchema }}],
|
||||
{{- range $e := $n.Edges }}
|
||||
{{- if and $e.M2M (not $e.Inverse) (not $e.Through) }}
|
||||
{{ $n.Name }}{{ $e.StructField }}: tableSchemas[{{ indexOf $all $e.TableSchema }}],
|
||||
{{- end }}
|
||||
{{- if and $e.M2M (not $e.Inverse) (not $e.Through) }}
|
||||
{{ $n.Name }}{{ $e.StructField }}: tableSchemas[{{ indexOf $all $e.TableSchema }}],
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user