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

Singular resources #6

Open
tj opened this issue Apr 10, 2011 · 9 comments
Open

Singular resources #6

tj opened this issue Apr 10, 2011 · 9 comments
Milestone

Comments

@tj
Copy link
Member

tj commented Apr 10, 2011

we could use lingo.en.isSingular() to detect and auto-magically support this

@gf3
Copy link

gf3 commented Apr 10, 2011

I suppose it depends on how opinionated you want to be.

@tj
Copy link
Member Author

tj commented Apr 10, 2011

we definitely have to be flexible, but I think we can do magic, and retain the flexibility

@gf3
Copy link

gf3 commented Apr 10, 2011

Makes sense to me.

@macavon
Copy link

macavon commented Apr 10, 2011

You mean that resource('profile', actions) makes a singular resource and resource('users', actions) a plural one, right? This seems intuitively appealing, but you know someone's going to try resource('sheep', actions) don't you? So maybe you do need some way of disambiguating or over-riding the convention.

Also, presumably people will immediately start wanting to use different languages. Words ending in 's' will look the same singular and plural in French, also Spanish apparently.

@tj
Copy link
Member Author

tj commented Apr 10, 2011

that's the idea, it would basically just expand at the API level, so something like resource('profile') would make a call to say singularResource('profile') similar, allowing the call to be explicit when needed but still adding some sugar on top of the high level portion of the API. Just a thought.

@macavon
Copy link

macavon commented Apr 10, 2011

It's a very good thought, but you might be wise to expose singularResource anyway, to get round the awkward cases.

@tj
Copy link
Member Author

tj commented Apr 10, 2011

yup, that's the plan

@macavon
Copy link

macavon commented Apr 20, 2011

I still like the idea of using magic, but I've just sent a pull request with a different way of doing it.

I'm sure I must have missed something, otherwise it's too easy.

@sgronblo
Copy link

sgronblo commented Jan 8, 2014

I guess nobody is working on this anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants