-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Document serialization interface and what to test #967
Conversation
- `#to_json(options)`: string representation (JSON) to Hash from `as_json` | ||
- `#cache_key`: a (self-expiring) unique key for the instance, used by the adapter | ||
- `#id`: a unique identifier for the object | ||
- `::model_name`: an ActiveModel::Name instance, used by the serializer to identify the type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #996
@bf4 hi :) left you some notes |
Oof, my brain can't handle code right now, I'll review prose though! 😄 |
Serializable resources must include [`ActiveModel::Serialization`](https://github.com/rails/rails/blob/master/activemodel/lib/active_model/serialization.rb) | ||
or implement its interface: | ||
|
||
- `#serializable_hash(options)`: hash representation of a resources attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we detail the current/future options?
BTW not README anymore, focus on spread this information the docs. 😄 |
I've been meaning to come back to this to add serializer test helpers. the linter and and interface docs are done |
Extracted from #954
ref: #878 (comment)