You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to generate a "pepsi" resource in a new buffalo app, the generator sometimes generates the proper names "pepsi/pepsis", and sometimes it generates "pepse/pepses".
METHOD
PATH
NAME
HANDLER
GET
/
rootPath
coke/actions.HomeHandler
GET
/pepsis/
pepsisPath
coke/actions.PepsisResource.List
POST
/pepsis/
pepsisPath
coke/actions.PepsisResource.Create
GET
/pepsis/new/
newPepsisPath
coke/actions.PepsisResource.New
GET
/pepsis/{pepse_id}/
pepsePath
coke/actions.PepsisResource.Show
PUT
/pepsis/{pepse_id}/
pepsePath
coke/actions.PepsisResource.Update
DELETE
/pepsis/{pepse_id}/
pepsePath
coke/actions.PepsisResource.Destroy
GET
/pepsis/{pepse_id}/edit/
editPepsePath
coke/actions.PepsisResource.Edit
These inconsistencies are also present in the code of the generated actions, for example:
// List gets all Pepsis. This function is mapped to the path
// GET /pepsis
func (v PepsisResource) List(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return fmt.Errorf("no transaction found")
}
pepses := &models.Pepsis{}
Steps to Reproduce the Problem
Generate a new buffalo app with buffalo new dummyapp, and set it up
Inside your new app's folder run buffalo generate resource pepsi
Check the generated code, or start your app in development mode, and try to create a new pepsi entry
Expected Behaviour
"Pepsi" is a weird word, but pluralizing it does make sense, in my opinion, probably as "pepsis", but in any case, I would expect the generator to produce consistent naming and functional codde.
Actual Behaviour
The naming is inconsistent and some routes are broken.
Info
Please run buffalo info and paste the information below where it says "PASTE_HERE".
-> Go: Checking installation
✓ The `go` executable was found on your system at: /snap/bin/go
-> Go: Checking minimum version requirements
✓ Your version of Go, 1.13.4, meets the minimum requirements.
-> Go: Checking GOPATH
✓ You are using Go Modules, so no need to worry about the GOPATH.
-> Go: Checking Package Management
✓ You are using Go Modules (`go`) for package management.
-> Go: Checking PATH
✓ Your PATH contains /home/mladen/go/bin.
-> Node: Checking installation
✓ The `node` executable was found on your system at: /home/mladen/.nvm/versions/node/v13.5.0/bin/node
-> Node: Checking minimum version requirements
✓ Your version of Node, v13.5.0, meets the minimum requirements.
-> NPM: Checking installation
✓ The `npm` executable was found on your system at: /home/mladen/.nvm/versions/node/v13.5.0/bin/npm
-> NPM: Checking minimum version requirements
✓ Your version of NPM, 6.13.7, meets the minimum requirements.
-> Yarn: Checking installation
✓ The `yarnpkg` executable was found on your system at: /home/mladen/.nvm/versions/node/v13.5.0/bin/yarnpkg
-> Yarn: Checking minimum version requirements
✓ Your version of Yarn, 1.21.1, meets the minimum requirements.
-> PostgreSQL: Checking installation
✘ The `postgres` executable could not be found on your system.
For help setting up your Postgres environment please follow the instructions for you platform at:
https://www.postgresql.org/download/
-> MySQL: Checking installation
✓ The `mysql` executable was found on your system at: /usr/bin/mysql
-> MySQL: Checking minimum version requirements
✓ Your version of MySQL, 14.14, meets the minimum requirements.
-> SQLite3: Checking installation
✓ The `sqlite3` executable was found on your system at: /usr/bin/sqlite3
-> SQLite3: Checking minimum version requirements
✓ Your version of SQLite3, 3.22.0, meets the minimum requirements.
-> Cockroach: Checking installation
✘ The `cockroach` executable could not be found on your system.
For help setting up your Cockroach environment please follow the instructions for you platform at:
https://www.cockroachlabs.com/docs/stable/
-> Buffalo (CLI): Checking installation
✓ The `buffalo` executable was found on your system at: /usr/local/bin/buffalo
-> Buffalo (CLI): Checking minimum version requirements
✓ Your version of Buffalo (CLI), v0.15.3, meets the minimum requirements.
-> Buffalo: Application Details
Pwd /home/mladen/Projects/BuffaloTest/coke
Root /home/mladen/Projects/BuffaloTest/coke
GoPath /home/mladen/go
PackagePkg coke
ActionsPkg coke/actions
ModelsPkg coke/models
GriftsPkg coke/grifts
WithModules true
Name coke
Bin bin/coke
VCS git
WithPop true
WithSQLite false
WithDep false
WithWebpack true
WithNodeJs true
WithYarn true
WithDocker true
WithGrifts true
AsWeb true
AsAPI false
InApp true
PackageJSON {map[build:webpack -p --progress dev:webpack --watch]}
-> Buffalo: config/buffalo-app.toml
name = "coke"
bin = "bin/coke"
vcs = "git"
with_pop = true
with_sqlite = false
with_dep = false
with_webpack = true
with_nodejs = true
with_yarn = true
with_docker = true
with_grifts = true
as_web = true
as_api = false
-> Buffalo: config/buffalo-plugins.toml
[[plugin]]
binary = "buffalo-pop"
go_get = "github.com/gobuffalo/buffalo-pop"
-> Buffalo: go.mod
module coke
go 1.13
require (
github.com/gobuffalo/buffalo v0.15.3
github.com/gobuffalo/buffalo-pop v1.23.1
github.com/gobuffalo/envy v1.8.1
github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517
github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130
github.com/gobuffalo/mw-i18n v0.0.0-20190129204410-552713a3ebb4
github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525
github.com/gobuffalo/packr/v2 v2.7.1
github.com/gobuffalo/pop v4.13.1+incompatible
github.com/gobuffalo/suite v2.8.2+incompatible
github.com/gobuffalo/validate v2.0.3+incompatible
github.com/gofrs/uuid v3.2.0+incompatible
github.com/markbates/grift v1.5.0
github.com/stretchr/testify v1.4.0
github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c
)
The text was updated successfully, but these errors were encountered:
Description
When I try to generate a "pepsi" resource in a new buffalo app, the generator sometimes generates the proper names "pepsi/pepsis", and sometimes it generates "pepse/pepses".
These inconsistencies are also present in the code of the generated actions, for example:
Steps to Reproduce the Problem
buffalo new dummyapp
, and set it upbuffalo generate resource pepsi
Expected Behaviour
"Pepsi" is a weird word, but pluralizing it does make sense, in my opinion, probably as "pepsis", but in any case, I would expect the generator to produce consistent naming and functional codde.
Actual Behaviour
The naming is inconsistent and some routes are broken.
Info
Please run
buffalo info
and paste the information below where it says "PASTE_HERE".The text was updated successfully, but these errors were encountered: