Skip to content

Fix inheritance of parent_controller when controllers were eagerly loaded#3458

Merged
mshibuya merged 1 commit into
railsadminteam:masterfrom
jalyna:fix/main-controller-preloaded
Jan 24, 2022
Merged

Fix inheritance of parent_controller when controllers were eagerly loaded#3458
mshibuya merged 1 commit into
railsadminteam:masterfrom
jalyna:fix/main-controller-preloaded

Conversation

@jalyna

@jalyna jalyna commented Jan 24, 2022

Copy link
Copy Markdown
Contributor

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

coveralls commented Jan 24, 2022

Copy link
Copy Markdown

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
Copy Markdown
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