Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Generated resource "statuses" inconsistent #794

Closed
mikeroosa opened this issue Dec 14, 2017 · 1 comment
Closed

Generated resource "statuses" inconsistent #794

mikeroosa opened this issue Dec 14, 2017 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mikeroosa
Copy link

mikeroosa commented Dec 14, 2017

At the command line I typed:

buffalo g resource statuses name is_active:bool

In actions/statuses.go, I see:
/ Following naming logic is implemented in Buffalo:
// Model: Singular (Statuse)
// DB Table: Plural (statuses)
// Resource: Plural (Statuses)
// Path: Plural (/statuses)
// View Template Folder: Plural (/templates/statuses/)

Singular should be Status, but that's not the big problem. In actions/statuses.go it had this code throughout:

status := &models.Statuse{}

However, there was no models/statuse.go file. There was a models/status.go file.

In the models/status.go everything referred to the singular so I had to update this section:

// Statuses is not required by pop and may be deleted
type Statuses []Status

// String is not required by pop and may be deleted
func (s Statuses) String() string {
	js, _ := json.Marshal(s)
	return string(js)
}
@stanislas-m stanislas-m added the bug Something isn't working label Dec 14, 2017
@markbates
Copy link
Member

@markbates markbates added this to the 0.10.3 milestone Dec 15, 2017
@markbates markbates self-assigned this Dec 15, 2017
markbates added a commit that referenced this issue Dec 15, 2017
Generated resource "statuses" inconsistent fixes #794
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants