Skip to content

Commit

Permalink
Fixed resource generation for irregular words
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Jul 19, 2021
1 parent 105e630 commit b693dcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SearchLight"
uuid = "340e8cb6-72eb-11e8-37ce-c97ebeb32050"
authors = ["Adrian Salceanu <[email protected]>"]
version = "1.0.0"
version = "1.0.1"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
5 changes: 3 additions & 2 deletions src/Generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Generates a new SearchLight model file and persists it to the resources folder.
"""
function newmodel(name::Union{String,Symbol}; path::Union{String,Nothing} = nothing, pluralize::Bool = true) :: Nothing
name = string(name) |> uppercasefirst
model_name = Inflector.is_singular(name) ? Inflector.to_plural(name) : name
model_name = (Inflector.is_singular(name) ? Inflector.to_plural(name) : name) |> uppercasefirst

model_path = setup_resource_path(model_name, path)
mfn = model_file_name(model_name)
Expand All @@ -39,12 +39,13 @@ function newresource(resource_name::Union{String,Symbol}; path::Union{String,Not
sf = Inflector.to_singular(resource_name)

model_name = (sf === nothing ? resource_name : sf) |> uppercasefirst

newmodel(model_name, path = path, pluralize = pluralize)
new_table_migration(resource_name, pluralize = pluralize)

resource_name = uppercasefirst(resource_name)
pluralize && Inflector.is_singular(resource_name) &&
(resource_name = Inflector.to_plural(resource_name))
(resource_name = Inflector.to_plural(resource_name) |> uppercasefirst)

resource_path = setup_resource_path(resource_name, path)
for (resource_file, resource_type) in [(validator_file_name(resource_name), :validator)]
Expand Down

2 comments on commit b693dcc

@essenciary
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/41161

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.1 -m "<description of version>" b693dccb2b75a563cb33efd7bf267d416521a564
git push origin v1.0.1

Please sign in to comment.