-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support transform keys for OjSerializers & AMS
- Loading branch information
Showing
8 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Typelizer digest 33937e09714b42648ac9414bb04c6834 | ||
// | ||
// DO NOT MODIFY: This file was automatically generated by Typelizer. | ||
import type {AmsUser, AmsPost} from '@/types' | ||
|
||
type AmsTransformKeys = { | ||
/** Unique identifier */ | ||
id: string | null; | ||
username: string; | ||
active: boolean; | ||
createdAt: string; | ||
invitor: AmsUser; | ||
posts: Array<AmsPost>; | ||
} | ||
|
||
export default AmsTransformKeys; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Typelizer digest 6395b48daf28e8585e1bac96f227a242 | ||
// | ||
// DO NOT MODIFY: This file was automatically generated by Typelizer. | ||
import type {OjSerializersUser, OjSerializersPost} from '@/types' | ||
|
||
type OjSerializersTransformKeys = { | ||
id: number; | ||
username: string; | ||
active: boolean; | ||
invitor: OjSerializersUser; | ||
posts: Array<OjSerializersPost>; | ||
createdAt: string; | ||
} | ||
|
||
export default OjSerializersTransformKeys; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Ams | ||
class TransformKeysSerializer < UserSerializer | ||
attribute :created_at, key_transform: :camel_lower | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
spec/app/app/serializers/oj_serializers/transform_keys_serializer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module OjSerializers | ||
class TransformKeysSerializer < UserSerializer | ||
attribute :created_at | ||
|
||
transform_keys :camel_case | ||
end | ||
end |