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

Update model naming for arrays and refactor #58

Merged
merged 12 commits into from
Aug 7, 2024
Merged

Conversation

Manfred
Copy link
Owner

@Manfred Manfred commented Aug 7, 2024

  • Changes model naming so the model name for a collection doesn't conflict with its items.

An array could previously get the same model name as its items and that would result in an exception TypeError: no implicit conversion of Hash into Integer because we would attempt to initialize an Array subclass with a Hash of attributes.

This PR changes the logic to add Collection to the array model name, eg. BooksCollection so it doesn't conflict with the item model name, eg. Book.

References #52.

@Manfred Manfred merged commit a055bee into main Aug 7, 2024
3 checks passed
@Manfred Manfred deleted the manfred-52-naming branch August 7, 2024 12:36
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