Skip to content


Subversion checkout URL

You can clone with
Download ZIP


change in behavior when exposing a resource, which has no plural form #60

senny opened this Issue · 2 comments

3 participants


The previous versions of decent_exposure exposed the singular resource when you exposed a resource, which has no plural:


This used to expose a singular resource but with decent_exposure 2.0 it exposes the collection. Of course this breaks our application and is not handy to fix.

Since the collection can more easily be represented with the block form I suggest to change the behavior back to how it was.

decent_exposure 1.x

if respond_to?(collection) && collection != name.to_s && send(collection).respond_to?(:scoped)

decent_exposure 2.x

if plural?

I think it would be enough to add the collection != name.to_s to the plural? query.


Implementation aside, we shouldn't be treating the exposure as the collection when the resource is "uncountable". Thanks for catching this. I've added a 2.0.1 release milestone and added this to it. Please feel free to submit a pull request, otherwise @jgdavey or I will get to it as soon as we can.


Thanks for the heads-up.

@jgdavey jgdavey closed this issue from a commit
Joshua Davey and Keith Marcum For uncountable resources, assume singular
This fixes #60
@jgdavey jgdavey closed this in b76712f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.