Closed erikreedstrom closed 9 years ago
Yeah, that makes sense. I took this part from Spinejs.
I think using plural always is a better way to go (so there's no guessing).
But in the meanwhile you can just use this:
class User extends ko.Model
@getUrl = -> 'countries'
I think modifying persistAt
to accept plural string or a function is a better way to go. I'll keep this open until I'll have time to update it (or you can submit a PR with a spec).
The collection url generated by the getURL method is too opinionated about the pluralization rules associated with a model. Currently, the method appends "s" to the persisted model, however, this means that for a collection of "countries" the associated code would read:
@persistAt 'countrie'
This obviously is confusing and factually incorrect. I suggest removing the appended "s".