-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Overriding the controller #68
Comments
Hey Scott. Sorry you’re running into this issue.
It looks like it’s a loading error. Is PdfHelper defined in
app/helpers/pdf_helper.rb?
|
Correct, however I have a feeling the pdf helper is a red herring
…On Oct 13, 2020, 9:57 PM -0700, Ricky Chilcott ***@***.***>, wrote:
Hey Scott. Sorry you’re running into this issue.
It looks like it’s a loading error. Is PdfHelper defined in
app/helpers/pdf_helper.rb?
On Tue, Oct 13, 2020 at 11:45 PM Scott Barrow ***@***.***>
wrote:
> Bug Report
>
> *Please help us help you by filling out any applicable information in this
> template and removing the rest!*
> Describe the bug
>
> Thank you for implementing the controller override @rickychilcott
> <https://github.com/rickychilcott> , @julianrubisch
> <https://github.com/julianrubisch> .
> Unfortunately, I was not available to test this while it was in PR against
> my codebase, however I'm doing this now and of course I seem to have an
> issue
> To Reproduce
>
> Steps to reproduce the behavior
> Expected behavior
>
> A clear and concise description of what you expected to happen.
> Screenshots or reproduction
>
> /Users/scott/Code/Ollie/OllieOrder/config/initializers/futurism.rb:3 :
>
> 1: require 'pry'
> 2: binding.pry
> => 3: Futurism.default_controller = OrganizationsController
>
> [7] pry(main)> Futurism.default_controller = OrganizationsController
> NameError: Couldn't find, expected it to be defined in helpers/pdf_helper.rb
> from /Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.4/lib/abstract_controller/helpers.rb:163:in `rescue in block in modules_for_helpers'
> Caused by LoadError: Unable to autoload constant PdfHelper, expected /Users/scott/Code/Ollie/OllieOrder/app/helpers/pdf_helper.rb to define it
> from /Users/scott/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:550:in `load_missing_constant'
> [8] pry(main)>
>
> Versions Futurism
>
> - Gem: [e.g. 0.6.0]
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#68>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADM2P2P6ZGO62PYQGYSZPTSKUNHFANCNFSM4SQBU43Q>
> .
>
--
Ricky Chilcott
Partner
Mission Met
(740) 561-1361
***@***.***
www.missionmet.com
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Now that I think about it, It might be that the initializer is too early for everything to be properly loaded. https://github.com/thoughtbot/clearance/blob/4473448ab00faed7d57582cc38227c8c3d72e511/lib/clearance/configuration.rb#L140 Is an example of how the clearance gem handles it. We will need to change the config to a string version of the class and it will be lazily converted to the class at runtime. I think this is an issue with zeitworks autoload I may be able to get a PR in tomorrow morning with a change. I also have a nearly finished PR for the parameter passing issue. I ran out of time while fixing up the test suite today. |
That would make sense, amazing, thank you for chasing this and the params issue! |
Bug Report
Please help us help you by filling out any applicable information in this template and removing the rest!
Describe the bug
Thank you for implementing the controller override @rickychilcott , @julianrubisch .
Unfortunately, I was not available to test this while it was in PR against my codebase, however I'm doing this now and of course I seem to have an issue
To Reproduce
Steps to reproduce the behavior
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots or reproduction
The pdf_helper seems to be a red herring, but do is there a reason I cannot use the controller constants in the initializer?
Versions
Futurism
The text was updated successfully, but these errors were encountered: