Skip to content

ActiveAdmin uses Pluralized file names #692

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

Conversation

danielricecodes
Copy link
Contributor

Changing ActiveAdmin code so it reads pluralized model named files. This is how active admin generates the files when using its own generator, so I think this gem ought to follow what the gem produces in its own generator.

Ex:

rails g active_admin:resource Foo will create a file with a pluralized file name app/admin/foos.rb.

@drwl
Copy link
Collaborator

drwl commented Dec 17, 2019

Thanks @danielricecodes for the PR and good description. Would it be possible to add a test for this?

@drwl
Copy link
Collaborator

drwl commented Apr 5, 2020

Closing in favor of #776, feel free to reopen if anything else changes.

@drwl drwl closed this Apr 5, 2020
drwl pushed a commit that referenced this pull request May 9, 2020
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. :)
ocarta-l pushed a commit to ocarta-l/annotate_models that referenced this pull request Jun 18, 2021
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. :)
@danielricecodes danielricecodes deleted the active-admin-pluralized-names branch January 20, 2023 00:41
dazralsky pushed a commit to dazralsky/annotate_models that referenced this pull request Aug 21, 2023
This is an addition to this PR: ctran/annotate_models#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. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants