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

Pluralized types global opt-in #225

Merged
merged 1 commit into from Feb 20, 2017
Merged

Pluralized types global opt-in #225

merged 1 commit into from Feb 20, 2017

Conversation

bcardarella
Copy link
Contributor

Reference issue: #118

Allow API to produce pluralized types rather than having to configure
each serializer one by one.

Reference issue: #118

Allow API to produce pluralized types rather than having to configure
each serializer one by one.
@@ -212,19 +212,23 @@ defmodule JaSerializer.Serializer do

defp define_default_type(module) do
type_from_module = module
|> Atom.to_string
|> String.split(".")
|> Module.split()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a small refactor here

|> List.last
|> String.replace("Serializer", "")
|> String.replace("View", "")
|> JaSerializer.Formatter.Utils.format_type
|> JaSerializer.Formatter.Utils.format_type()
|> pluralize_type(Application.get_env(:ja_serializer, :pluralize_types))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could debate on if the pluralization should happen before or after the formatting

@alanpeabody
Copy link
Contributor

Your up early!

I am totally fine with making this configurable, thanks @bcardarella.

@alanpeabody alanpeabody merged commit cc30df7 into vt-elixir:master Feb 20, 2017
@bcardarella bcardarella deleted the feature/bc/global-pluralized-types branch February 20, 2017 15:33
@warmwaffles
Copy link

@alanpeabody can we get a release cut for this? Last time a release was deployed was Feb 19.

@lucas-nelson
Copy link

🙏 @alanpeabody a new release on hex.pm would be a great help

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.

None yet

4 participants