scoutforpets / jsonapi-mapper

JSON API-Compliant Serialization for your Node ORM
The Unlicense
42 stars 24 forks source link

API changes (#59) #75

Closed chamini2 closed 8 years ago

chamini2 commented 8 years ago

The test that fails is a test that I'm not sure if should keep passing or not.

chamini2 commented 8 years ago

@jamesdixon, after deciding what to do with the failing test we could merge this. I changed from keyForAttribute to keyForAttr since we had omitAttrs already.

jamesdixon commented 8 years ago

@chamini2 I think pluralizeType should always be false true given that we are allowing the user to pass typeForModel (maps to typeForAttribute). This does affect both the type of the model and the relationships. Just confirmed on my end.

chamini2 commented 8 years ago

@jamesdixon , so It's ok ignoring the pluralizeType option and users should just use typeForModel to stop pluralizing (it would just be {typeForModel: identity}).

jamesdixon commented 8 years ago

Yes, I believe so. I'm already essentially doing this (my models are all singular), so I pass typeForAttribute: (attr) => singularize(attr) and it singularizes all my types (model & relationships)

chamini2 commented 8 years ago

@jamesdixon, done.

jamesdixon commented 8 years ago

@chamini2 all looks good here. Feel free to merge!