Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CakePHP 2.3.6. Need one more Inflector rule for qouta/quotas noun #2077

Closed
ghost opened this issue Oct 11, 2013 · 16 comments
Closed

CakePHP 2.3.6. Need one more Inflector rule for qouta/quotas noun #2077

ghost opened this issue Oct 11, 2013 · 16 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Oct 11, 2013

Created by SergeRod, 26th Jun 2013. (originally Lighthouse ticket #3890):


What I did

Inflector::singularize("quotas")
Inflector::pluralize("quota")

What happened

Baking model (cake bake model Quota) for 'quotas' table fails.

What I expected to happen

quota (singular) <==> quotas (plural)

@ghost
Copy link
Author

ghost commented Oct 11, 2013

25th Jun 2013, euromark said:


If you check http://inflector.cakephp.org/ you will see that quota/quotas inflects correctly.
You also state that in your ticket (happened is the same than expected).

What exactly does it say besides "table fails"?
I think there is another issue here involved. The inflection itself is fine.

@ghost
Copy link
Author

ghost commented Oct 11, 2013

25th Jun 2013, SergeRod said:


Your're right. Inflector works fine. Model baking process fails for table 'quotas' if model name passed as singular: 'Quota' (cake bake model Quota). The 'cake bake model Quotas' command works fine.

@ghost
Copy link
Author

ghost commented Oct 11, 2013

26th Jun 2013, ADmad said:


The problem lies in Shell::_modelName() which converts supplied model name Quota to Quotum.

@SergeRod Would have helped if you have provided the accurate error message :) The exact error shown when doing cake bake model Quota is "Table quota for model Quotum was not found in datasource default."

@ghost
Copy link
Author

ghost commented Oct 11, 2013

26th Jun 2013, ADmad said:


The question is whether "Quota" itself is singular or plural. As per http://en.wiktionary.org/wiki/quota it seems quota can be used as singular. Native english speakers can decide :)

@ravage84
Copy link
Member

Seems to be clear
http://www.thefreedictionary.com/quota

Quota = single
Quotas = plural

(not a native English speaker though)

@lorenzo
Copy link
Member

lorenzo commented Oct 15, 2013

This is an actual bug in the inflector. Any takers?

@markstory
Copy link
Member

I'll take a look.

@ghost ghost assigned markstory Oct 15, 2013
@ravage84
Copy link
Member

I'm confused. The new test cases proof everything is OK?
When I test quota on http://inflector.cakephp.org/ I get

singularize => quotum

@dereuromark
Copy link
Member

The inflector still runs on 2.3 afaik. And that quota fix was somewhere in 2.4 I imagine.

@ravage84
Copy link
Member

@dereuromark Bad for using it in discussions in PRs and issues ;-)

@ravage84
Copy link
Member

A spontaneous idea:
Could we show the version number of CakePHP that http://inflector.cakephp.org/ is using?
That could avoid insecurities...

@dereuromark
Copy link
Member

Sure, PR that.

@ravage84
Copy link
Member

@dereuromark According to the README it's running on 2.4...

@dereuromark
Copy link
Member

No, I upgraded it to "be able to run" with Cake2.4. But at the time, it was still not stable, so it was decided to keep 2.3.
But I vote for upgrading to 2.4 now :)

@ravage84
Copy link
Member

@dereuromark I'm already working on a PR which upgrades it.

@ravage84
Copy link
Member

The PR with the upgrade: cakephp/inflector.cakephp.org#4

ADmad pushed a commit to ADmad/cakephp that referenced this issue Oct 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants