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

Include module in engine's application contorller causes circular dependency error #19079

Closed
emclab opened this issue Feb 25, 2015 · 7 comments
Closed
Labels

Comments

@emclab
Copy link

emclab commented Feb 25, 2015

in_quotex is a Rails 4.2.0 engine. In its application controller, there includes:

module InQuotex
class ApplicationController < ::ApplicationController
include BizWorkflowx::WfHelper
.....
end

When loading the WfHelper module, there is an error if we run InQuotex::QuotexController.public_instance_methods:

InQuotex::QuotesController.public_instance_methods(false) = {RuntimeError}Circular dependency detected while autoloading constant InQuotex::QuotesController

The error above disappears (return empty array) if the include is moved into quotes controller from engine's application controller. The same code does not cause any error in Rails 3.2.12.

@emclab
Copy link
Author

emclab commented Feb 25, 2015

BTW none of the methods defined in WfHelper was there for quotes controller. I am wondering if it has something to do with this circular dependency error.

@kaspth
Copy link
Contributor

kaspth commented Feb 25, 2015

Let's test this a bit.

Can you try defining your engines' application controller as class InQuotex::ApplicationController < ApplicationController and report back?

Likewise fully qualifying the include as include ::BizWorkflowx::WfHelper.

@emclab
Copy link
Author

emclab commented Feb 25, 2015

  1. Define in engine's application controller as: class InQuotex::ApplicationController < ApplicationController

    Same error.

And 2. fully qualifying the include as include ::BizWorkflowx::WfHelper

 Same error.

@kaspth
Copy link
Contributor

kaspth commented Feb 26, 2015

Can you reproduce the error in a sample application?

@emclab
Copy link
Author

emclab commented Feb 26, 2015

I can try later. I am working on engine upgrading to rails 4.2.0 with an issue I am trying to solve for last a few days.

@rails-bot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-2-stable, 4-1-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@rails-bot
Copy link

This issue has been automatically closed because of inactivity.

If you can still reproduce this error on the 4-2-stable, 4-1-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

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

No branches or pull requests

3 participants