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

17 add a serializer #32

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

17 add a serializer #32

wants to merge 8 commits into from

Conversation

keeganoshea
Copy link
Collaborator

No description provided.

existing behavior as close as possible
we should choose camelCase or snake_case
and stick with it
@keeganoshea keeganoshea linked an issue Mar 25, 2024 that may be closed by this pull request
class CarSerializer
include JSONAPI::Serializer

set_key_transform :camel_lower
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We will want to agree that we want to use this. That means we would need to update things like these to use camel casing.

<p>initial_mileage: {{ car.initial_mileage }}</p>
<p>purchase_date: {{ car.purchase_date }}</p>
<p>purchase_vendor: {{ car.purchase_vendor }}</p>


expect(attributes[:name]).to eq "Jim's Fiat 500"
expect(attributes[:userName]).to eq user.name
# expect(attributes[:image]).to be_kind_of(String)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Still working on getting the image serialized correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Serializer
1 participant