Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

fix resource name handling bug #1019

Merged
merged 1 commit into from
Apr 10, 2018

Conversation

sio4
Copy link
Member

@sio4 sio4 commented Apr 10, 2018

Hi, while I generate resource named resources, I found a bug on name detection routine Resource() function.

If I generate my resource with "resource" (buffalo generate resource resources), the structure name of generated resource is ResourcesResource and strings.Replace() on Resource() of router.go replaces first Resource and remaining sResource is used as resource name.

I replaced Replace() with TrimSuffix() and I think it is fit for the logic too.
I also added some test cases for this.

@markbates markbates requested a review from paganotoni April 10, 2018 18:58
@markbates markbates added this to the 0.11.1 milestone Apr 10, 2018
Copy link
Member

@paganotoni paganotoni left a comment

Choose a reason for hiding this comment

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

This looks good, thanks @sio4

@paganotoni paganotoni merged commit 7adf4a2 into gobuffalo:development Apr 10, 2018
@sio4
Copy link
Member Author

sio4 commented Apr 10, 2018

Thank you all for this lovely framework! @markbates @paganotoni

@sio4 sio4 deleted the resource-named-resource branch October 17, 2018 08:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants