-
Notifications
You must be signed in to change notification settings - Fork 3
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
Moved shared published functionality to concern #27
Conversation
Yeah, I know doing many things in AA is hard. Extending DSL is the best option here. There are some AA extensions already in the code I have a little cleanup in mind, maybe I could try to add that extension here. |
Do it! :D |
I'm also thinking if scope |
We could not have "All" and just keep the specific ones, for clarity. Not sure when they'd need them all in a page. |
Maybe default to Published. |
I'm talking about model |
That archived sounds for me like "soft-deleted". That should not be present in any select where you can link association. |
We need |
oh right, yes, I get it. We should prevent archived objects from being linked to other objects, as they are archived. Makes sense to exclude archived from that. |
Exactly, take a look at last commit, not sure what else could go into publishable "concern" for ActiveAdmin. I think loading extensions in this way is cleaner (to have them separately and load in initializer), what do you think? |
That's quite nice and tidy. when I was looking at it, I couldn't see much else either. Potentially the sidebar bit for the show page? |
Right, I thought that only one sidebar block is allowed but apparently we can add as many separate sidebar blocks as we want. Good idea, I will add it as a separate |
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.
We can do that scope for archive and testing in separate PR.
Thanks for the help! =) |
This PR extracts the visibility status usage to a concern to be shared by different models.
I haven't done the same to the Admin pages under
app/admin
as I wasn't able to find a lot of guidance. I thought about extracting the scopes into a new concern for the admin bits, but not sure if it's worth it.One example I found on Stack Overflow mentions using
extend
instead of include, because it seems that Active Admin doesn't support the ActiveSupport::Concern: https://stackoverflow.com/questions/27325605/dry-ing-up-activeadminAlso found this word of warning: https://tmichel.github.io/2015/02/22/sharing-code-between-activeadmin-resources/