You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ApplicationController and Helpers are not being reloaded in Dev Env #697
I've been on 1.3.1 of InheritedResources (the latest) for quite awhile and have had this problem ever since forever. It's kind of annoying, especially since my CanCan current_ability method is inside the application controller. I think the helpers not being reloaded is a side-effect of the controller not being reloaded because helpers are all loaded from the application controller.
I'm on AA 0.4.3, Rails 3.2.2, Ruby 1.9.3-p194 (latest I'm aware of).
Unload currently does a lot of work to remove the objects from memory, but there must be a reference to the controller somewhere that's not being removed. If only Ruby made it easy to see the references keeping an object in memory...
@glebtv not sure if this is the right issue to report, but i am experiencing the same issue with AA 1.4.3, rails 5.2.2.
Forced to re-start rails app after a few changes while developing admin part of application or otherwise it becomes unusable.
Is there something that can be done to address it? Thanks.
Trying a patch from merged PR https://github.com/rails/rails/pull/31442/files indeed increased reload speed of application, but now activeadmin does not reloads in dev env on files (app/admin/*) change, changes respected only after server restart, any idea where to dig regards this?
Thanks!
Hello, everyone! Facing this issue in my project. Really need to DRY my code in some AA views with helpers. Is there any temporary hack for this issue? This hack seems not to work for me:
To update your helpers automatically, you can temporary hack it like:
I just ran into this as well, and was wondering why I had to restart my server after any change in my helper file. I was just wondering if this is easier now with Zeitwerk and Rails 6 / Rails 7?
The default branch is ready for a v4 release so I would be very open to these type of changes, I’m just not familiar with Rails autoloading to know what’s safe. I’ve been developing the new version of ActiveAdmin so I’ve experienced the pain of having to restart the dev server when making any changes. Since I've extracted partials I’ve had much better success. I would love to do the same with controllers or other files. If you’d like to help please let me know.
Activity
groe commentedon Mar 14, 2012
What exactly is the problem; what do you mean? And how is (caching of) your ApplicationController related to ActiveAdmin?
elia commentedon May 15, 2012
@pcreux I'm having the same problem (v0.4.3)
pcreux commentedon May 15, 2012
@fu-media It was closed because you didn't give any details. :)
pcreux commentedon May 15, 2012
Could you guys give a try to v0.4.4 with the latest version of inherited resources. This bug might come from inherited resources.
elia commentedon May 15, 2012
@pcreux I switched to head and
application_controllerremains cached, I'll try abundle update inherited_resourcesand tell you what happens :)latortuga commentedon May 15, 2012
I've been on 1.3.1 of InheritedResources (the latest) for quite awhile and have had this problem ever since forever. It's kind of annoying, especially since my CanCan
current_abilitymethod is inside the application controller. I think the helpers not being reloaded is a side-effect of the controller not being reloaded because helpers are all loaded from the application controller.I'm on AA 0.4.3, Rails 3.2.2, Ruby 1.9.3-p194 (latest I'm aware of).
elia commentedon May 15, 2012
@pcreux me too, on head activeadmin and latest inherited_resources I get cached application_controller methods
pcreux commentedon May 15, 2012
@gregbell was saying that the latest version of Inherited Resources would fix this issue in #342. Looks like he was wrong. :)
pcreux commentedon May 15, 2012
@fu-media I don't know why it's cached.
jpmckinney commentedon Jul 10, 2012
Experiencing this as well.
ddidier commentedon Nov 21, 2012
+1
18 remaining items
seanlinsley commentedon Feb 29, 2016
Disconnecting this from the Rails reloading, I can reproduce by simply calling
ActiveAdmin.unload!Unload currently does a lot of work to remove the objects from memory, but there must be a reference to the controller somewhere that's not being removed. If only Ruby made it easy to see the references keeping an object in memory...
seanlinsley commentedon Feb 29, 2016
Well the Mass gem isn't reporting any references.
seanlinsley commentedon Feb 29, 2016
This didn't seem to help:
glebtv commentedon Sep 20, 2018
Might be related - rails code reloading becomes slower with each reload, when anything is present in app/admin folder
To reproduce:
For one app I have, with 100+ activeadmin modules, it is 2s for first reload, 4s for second, and up to 2-3 minutes to complete hang in 10-15 reloads.
mvoropaiev commentedon Mar 13, 2019
@glebtv not sure if this is the right issue to report, but i am experiencing the same issue with AA 1.4.3, rails 5.2.2.
Forced to re-start rails app after a few changes while developing admin part of application or otherwise it becomes unusable.
Is there something that can be done to address it? Thanks.
deivid-rodriguez commentedon Mar 13, 2019
No news here, but I've seen several development environment memory leaks fixed in Rails recently, so maybe Rails 6 brings new hope here.
In particular, there's rails/rails#32892 and a related open PR. It'd be good if some hitting this problem could try that patch!
mvoropaiev commentedon Mar 26, 2019
Trying a patch from merged PR https://github.com/rails/rails/pull/31442/files indeed increased reload speed of application, but now activeadmin does not reloads in dev env on files (
app/admin/*) change, changes respected only after server restart, any idea where to dig regards this?Thanks!
kaneru commentedon Dec 18, 2019
Hello, everyone! Facing this issue in my project. Really need to DRY my code in some AA views with helpers. Is there any temporary hack for this issue? This hack seems not to work for me:
sethdeckard commentedon Aug 23, 2021
Given the age of this bug, I'm assuming this may not ever be fixed. What is a good alternative approach to using helpers in AA these days?
ndbroadbent commentedon Jul 15, 2022
I just ran into this as well, and was wondering why I had to restart my server after any change in my helper file. I was just wondering if this is easier now with Zeitwerk and Rails 6 / Rails 7?
rogerkk commentedon Nov 2, 2022
@ndbroadbent I still have to restart when i make changes to helpers, even under Zeitwerk on Rails 6.
jcarlson commentedon Aug 23, 2023
Can this issue be reopened? This is still an issue with the following configuration:
This issues is also mentioned in the "Gotchas" section of the docs which, by the way, are not linked from the table of contents.
javierjulio commentedon Dec 16, 2023
The default branch is ready for a v4 release so I would be very open to these type of changes, I’m just not familiar with Rails autoloading to know what’s safe. I’ve been developing the new version of ActiveAdmin so I’ve experienced the pain of having to restart the dev server when making any changes. Since I've extracted partials I’ve had much better success. I would love to do the same with controllers or other files. If you’d like to help please let me know.
jaynetics commentedon Jun 17, 2024
edit: in recent 4.0.0.beta versions this is fixed 🎉
previous reply:
putting this in an initializer is a bit hacky but does the trick as a workaround.