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

Document serialization interface and what to test #967

Closed
wants to merge 3 commits into from

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Jun 24, 2015

Extracted from #954

ref: #878 (comment)

- `#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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #996

@locks
Copy link

locks commented Jul 14, 2015

@bf4 hi :) left you some notes

@bf4
Copy link
Member Author

bf4 commented Jul 14, 2015

@locks and they are awesome. This PR is basically on hold while #994 is dished out. I also intent to extract parts of it into linters / 'shared tests' such as in #996

Wanna look at #954 (if you haven't already)? It requires brains. ☁️ 💡 😄

@locks
Copy link

locks commented Jul 14, 2015

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
Copy link
Contributor

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?

@joaomdmoura
Copy link
Member

BTW not README anymore, focus on spread this information the docs. 😄

@bf4
Copy link
Member Author

bf4 commented Feb 22, 2016

I've been meaning to come back to this to add serializer test helpers. the linter and and interface docs are done

@bf4 bf4 closed this Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants