-
-
Notifications
You must be signed in to change notification settings - Fork 578
Improved generator using flect to handle plurals properly #1455
Conversation
Sorry for annoying comments during explorering. :-) I edited comments and removed some useless comments. Question 1 I found function --- a/name/url.go
+++ b/name/url.go
@@ -1,5 +1,5 @@
package name
func (n Ident) URL() Ident {
- return Ident{n.Pluralize().Underscore()}
+ return Ident{n.File().Pluralize()}
} How do you think about this? Can I PR it before further progress? |
Question 2 When I fall into the r.Auto(...), I have no idea to get paths of the templates since there is only Currently, I have two Ideas
Any Ideas? |
The results of flect should match the results of inflect, so if you have to make changes there, go for it! Please don’t wait for permission to open a PR, I would rather make suggestion on a PR than for you to wait for me to answer a question. 🙂 The answer to question 2 is leave. It as is. I investigated “true” nested resources ages ago, but the Go package structure makes it difficult as well. Another this is the generator will be the next to be converted to genny, once I get the PR with the other generators merged. Don’t spend too much time improving this generator. Any change you make now will need to be ported to the genny implementation. |
Hi @markbates,
OK, I opened PR for
OMG! yes, I knew about your recent works on another branch! but I forget that and I just ran into this issue when I show the issue was labeled as Anyway, It works now for Many thanks! |
Improved generator to handle plurals properly, using
flect
instead ofinflect
.It will solve issue #1440.
Please check the test case I fixed. I think it will work smoothly but I cannot sure since this is the first time I look into
flect
and this parts of codes.Thanks.