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

[Feat] It now infers resource name from Serializer #309

Merged
merged 3 commits into from
Mar 26, 2023

Conversation

okuramasafumi
Copy link
Owner

Resource name inference worked like below:

Class name Resource name
FooResource Foo
FooSerializer FooSerializer
FooElse FooElse

However we noticed that lots of users use the term Serializer and the current behavior is not convenient. It now works like below:

Class name Resource name
FooResource Foo
FooSerializer Foo
FooElse FooElse

It now deletes Serializer suffix as well.

Resource name inference worked like below:

|Class name|Resource name|
| --- | --- |
| FooResource | Foo |
| FooSerializer | FooSerializer |
| FooElse | FooElse |

However we noticed that lots of users use the term `Serializer` and the current behavior is not convenient.
It now works like below:

|Class name|Resource name|
| --- | --- |
| FooResource | Foo |
| FooSerializer | Foo |
| FooElse | FooElse |

It now deletes `Serializer` suffix as well.
@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #309 (cee0875) into main (d7351d6) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #309      +/-   ##
==========================================
- Coverage   99.21%   99.20%   -0.01%     
==========================================
  Files          13       13              
  Lines         508      504       -4     
==========================================
- Hits          504      500       -4     
  Misses          4        4              
Impacted Files Coverage Δ
lib/alba/resource.rb 99.58% <100.00%> (-0.01%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

This simplifies `_key` and `_collection_key`.
Now that Alba supports "Serializer" suffix it should be mentioned.
@okuramasafumi okuramasafumi merged commit 2c45df5 into main Mar 26, 2023
@okuramasafumi okuramasafumi deleted the support-serializer-term branch March 26, 2023 10:13
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.

1 participant