Sha256: 6d90adad83d3d172e905d6d73f862ae26dc0466301e414577459bee0e2bd08df

Contents?: true

Size: 538 Bytes

Versions: 10

Compression:

Stored size: 538 Bytes

Contents

<%-
import 'context'
import model.package
import 'google.golang.org/appengine/datastore'
-%>

func (s *<%= type.name %>) PutWith(ctx context.Context, m *<%= model.qualified_name %>, f func() error) (*datastore.Key, error) {
	if s.Binder != nil {
		s.Binder.Prepare(m)
	}

	if s.Hook != nil {
		if err := s.Hook.BeforeValidation(ctx, m); err != nil {
			return nil, err
		}
	}

	if err := s.Validate(ctx, m); err != nil {
		return nil, err
	}
	if f != nil {
		if err := f(); err != nil {
			return nil, err
		}
	}

	return s.Put(ctx, m)
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
goon_model_gen-0.3.1 lib/goon_model_gen/templates/store/goon/20_PutWith.go.erb
goon_model_gen-0.3.0 lib/goon_model_gen/templates/store/goon/20_PutWith.go.erb
goon_model_gen-0.2.5 lib/goon_model_gen/templates/store/goon/20_PutWith.go.erb
goon_model_gen-0.2.4 lib/goon_model_gen/templates/store/goon/20_PutWith.go.erb
goon_model_gen-0.2.3 lib/goon_model_gen/templates/store/goon/19_PutWith.go.erb
goon_model_gen-0.2.2 lib/goon_model_gen/templates/store/goon/19_PutWith.go.erb
goon_model_gen-0.2.1 lib/goon_model_gen/templates/store/goon/19_PutWith.go.erb
goon_model_gen-0.2.0 lib/goon_model_gen/templates/store/goon/19_PutWith.go.erb
goon_model_gen-0.1.3 lib/goon_model_gen/templates/store/goon/19_PutWith.go.erb
goon_model_gen-0.1.2 lib/goon_model_gen/templates/store/goon/19_PutWith.go.erb