Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Avoid incrementing slug when reconciling #9

Open
suninthesky opened this issue Jun 17, 2020 · 1 comment
Open

Avoid incrementing slug when reconciling #9

suninthesky opened this issue Jun 17, 2020 · 1 comment

Comments

@suninthesky
Copy link
Contributor

# TODO: avoid incrementing slug when reconciling
def generate_slug(num = 1)
slug = name.parameterize
slug += "-#{num}" if num > 1
return slug unless Organisation.find_by(slug: slug)
generate_slug(num + 1)
end

@jdudley1123
Copy link
Member

Should no longer be an issue because org names are unique. If a a reconciled org has the same name as an existing org (and we have no other identifying information) they are treated as being the same.

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

No branches or pull requests

2 participants