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

Doesn't work with namespaced models #63

Closed
seandilda opened this Issue Sep 28, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@seandilda

I often use namespaced models when using STI, (ie rails generate model Foo::Bar --parent=Foo)

When I try to load upmin in one of these projects, I get NameError on line 14 of app/views/layouts/upmin/_navbar.html.haml (using gem version 0.1.0). Testing in rails console shows this is triggered when it tries to list one of my namespaced models.

@joncalhoun

This comment has been minimized.

Show comment
Hide comment
@joncalhoun

joncalhoun Sep 29, 2014

Member

This is likely related to #61 as well. I'll try to get both in the same PR.

Member

joncalhoun commented Sep 29, 2014

This is likely related to #61 as well. I'll try to get both in the same PR.

@joncalhoun joncalhoun added this to the v0.1.1 Release milestone Sep 29, 2014

@joncalhoun joncalhoun self-assigned this Sep 29, 2014

@joncalhoun

This comment has been minimized.

Show comment
Hide comment
@joncalhoun

joncalhoun Oct 12, 2014

Member

I am looking into this today. I'll hopefully have something within a few hours.

Member

joncalhoun commented Oct 12, 2014

I am looking into this today. I'll hopefully have something within a few hours.

@joncalhoun

This comment has been minimized.

Show comment
Hide comment
@joncalhoun

joncalhoun Oct 12, 2014

Member

@terrencetalbot @seandilda @ricardodovalle @russellmwolf Can a couple of you pull PR #90 and let me know how it works for you?

I am pretty sure that this should cover all namespace cases, but if you create your own admin model (eg AdminBlah) you will need to override the class method model_class as well, so I'll need to document that.

I did run into one other weird issue where basically some gems like ActsAsTaggableOn make it insanely annoying to pre-load their classes, so the ActsAsTaggableOn::Tag class may not show up in the admin pages until you view a model instance that has a tag, but if you go directly to the URL for the model it will still work. It just won't show up in the navbar prior to then. I'm not sure how to resolve that, since it might require custom code for tons of gems.

Member

joncalhoun commented Oct 12, 2014

@terrencetalbot @seandilda @ricardodovalle @russellmwolf Can a couple of you pull PR #90 and let me know how it works for you?

I am pretty sure that this should cover all namespace cases, but if you create your own admin model (eg AdminBlah) you will need to override the class method model_class as well, so I'll need to document that.

I did run into one other weird issue where basically some gems like ActsAsTaggableOn make it insanely annoying to pre-load their classes, so the ActsAsTaggableOn::Tag class may not show up in the admin pages until you view a model instance that has a tag, but if you go directly to the URL for the model it will still work. It just won't show up in the navbar prior to then. I'm not sure how to resolve that, since it might require custom code for tons of gems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment