Skip to content
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

Fix inheritance of parent_controller when controllers were eagerly loaded #3458

Merged

Conversation

jalyna
Copy link
Contributor

@jalyna jalyna commented Jan 24, 2022

Follow up on #2790

5bd9805 fixes the inheritance of the RailsAdmin::ApplicationController, nevertheless RailsAdmin::MainController.superclass.superclass is ActionController::Base instead of the configured ::ApplicationController, when accessing the main controller first (happens with eager loading).

Before the fix:

  1) RailsAdmin::Config.parent_controller= if RailsAdmin::ApplicationController is already loaded can be changed
     Failure/Error: expect(RailsAdmin::MainController.superclass.superclass).to eq ApplicationController

       expected: ApplicationController
            got: ActionController::Base

       (compared using ==)

       Diff:
       @@ -1 +1 @@
       -ApplicationController
       +ActionController::Base

@jalyna jalyna force-pushed the fix/main-controller-preloaded branch from 2fb3496 to 02c43be Compare January 24, 2022 11:49
@jalyna jalyna marked this pull request as ready for review January 24, 2022 11:55
@coveralls
Copy link

coveralls commented Jan 24, 2022

Pull Request Test Coverage Report for Build 1739656647

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.829%

Totals Coverage Status
Change from base Build 1736071775: 0%
Covered Lines: 7053
Relevant Lines: 7360

💛 - Coveralls

@mshibuya mshibuya merged commit ed8602a into railsadminteam:master Jan 24, 2022
@mshibuya
Copy link
Member

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants