-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Config is reset #515
Comments
+1 same here. |
reverted. |
Thank's for the report - I'll take a look. I suppose we're talking about model specific configurations within an initializer here? |
Yep. |
So that's my prototype for the fix. It includes moving all configurables under |
@bbenezech, @gunn, @sferik and anyone willing to review - I think I've got it together now. To recap on this feat; The intention is to provide lazy loading of configurations so that model classes and all that jazz don't get eager loaded for example when running rake tasks. It started with the idea of having model configurations done within model classes so that they wouldn't cause the premature loading which in turn caused some issues running migrations. That was all nice, but as this issue states model configurations done in initializers got lost during reset. Now the reset actually wasn't required by the original feature, but I thought it would be nice to have as it has been requested at some point - also having reset mechanism allows the tests to be better isolated and development cycle becoming bit faster (as model config changes become live). Wanting to keep the reset I implemented initializer calls to At some point when crafting the reset to be more exhaustive I came across the fact that some of our default configuration is stored in other places than Lastly I remembered we have batch accessors at config's disposal. Using any of those would render the lazy loading dysfunctional so I implemented As you see there's a lot going on here and I definitely need a code review. Please check it out and lets see how to proceed from there. Cheers! |
Thanks for all the hard work you've done, it's awesome. I'll cherry-pick and try it. |
👍 Nice work on this! |
@kaapa Can you check it against cancan? It blows a stacktrace on _current_user (in the controller mixin) |
@bbenezech good catch! Now fixed. |
Is this ready to merge? |
I consider this ready for merge - shall I do it? |
@kaapa Go for it! |
We're seeing a lot of problem with the new configuration style. I need to take a serious look at it. Since the Readme has been rewritten toward this new design, newcomers are facing issues that cannot easily be solved. |
Targetting next release. 0.0 will be initializer only, I guess. |
stalled |
Our configuration is applied then reset when our app starts. The culprit is the
to_prepare
method inlib/rails_admin/engine.rb
which runs after the configuration for some reason. It is added in this commit:d035100#diff-2
The text was updated successfully, but these errors were encountered: