-
Notifications
You must be signed in to change notification settings - Fork 639
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
ActiveAdmin: Allow for both singular and plural model names #776
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a question
let(:pattern_type) { 'admin' } | ||
let(:options) { {} } | ||
|
||
it 'returns an empty array' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expectation description accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right. I've updated the description. Thanks!
ccffeb7
to
b5029b6
Compare
I've updated the spec description, rebased on |
b5029b6
to
7caf867
Compare
I've resolved merge conflicts with the latest changes to @drwl can you please have a look? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's good to go except rubocop is complaining about the single vs double quotes. After that, this looks like it should be good to go 🙂.
7caf867
to
bbde2a7
Compare
bbde2a7
to
c1ad378
Compare
@drwl I fixed the rubocop issues, ran rubocop locally to confirm, rebased over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch! 👍
@vfonic to clarify, did you mean that running the tests would clear your branch? If so, I apologize for that. It was a hacky approach to getting integration tests working. I've since made it opt-in via env variable. Once this project stabilizes a bit more I'll work on making it non-destructive. |
@drwl Yes, that's what happened. Thanks for clarifying this! I'm glad to hear this wasn't a permanent solution. :) |
This is an addition to this PR: ctran#692 I've seen it's been stale for a while and it's rather simple fix. I noticed my ActiveAdmin resources are not being annotated. I know ActiveAdmin uses plural model names, but, as far as I remember, they used to use singular model names in the past. We can see some "evidence" of that here: https://activeadmin.info/2-resource-customization.html#customizing-parent-menu-items Probably in other places as well. In order to keep the gem working as expected for singular ActiveAdmin resources, I suggest we annotate both singular and plural model names. I just tested this out in a project of mine where I renamed one file to be in singular form and left the other files in plural form. It worked like a charm. :)
This is an addition to this PR: #692
I've seen it's been stale for a while and it's rather simple fix.
I noticed my ActiveAdmin resources are not being annotated.
I know ActiveAdmin uses plural model names, but, as far as I remember, they used to use singular model names in the past.
We can see some "evidence" of that here: https://activeadmin.info/2-resource-customization.html#customizing-parent-menu-items
Probably in other places as well.
In order to keep the gem working as expected for singular ActiveAdmin resources, I suggest we annotate both singular and plural model names.
I just tested this out in a project of mine where I renamed one file to be in singular form and left the other files in plural form.
It worked like a charm. :)
I also added a test, as best to my knowledge, as there are no similar tests that I could find.
Please let me know what you think!
/cc @danielricecodes @drwl
Also please, don't make the default rake task do a git checkout! I've never seen this and I've lost the above changes once due to this! I just didn't expect that running tests would be changing the source files in any way.