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: railtie loading to prevent calling methods that have not yet been defined #38

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

bibendi
Copy link
Contributor

@bibendi bibendi commented Sep 11, 2024

Hey!

In some cases (e.g., testing with optional dependencies) Yabeda may be loaded after a dummy Rails app is loaded. So, it as the common way to requre railties as late as possible.

NoMethodError:
  undefined method `already_configured?' for module Yabeda
# /usr/local/bundle/ruby/3.3.0/gems/yabeda-0.12.0/lib/yabeda/railtie.rb:7:in `block in <class:Railtie>'
# /usr/local/bundle/ruby/3.3.0/gems/activesupport-7.2.1/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
# /usr/local/bundle/ruby/3.3.0/gems/activesupport-7.2.1/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
# /usr/local/bundle/ruby/3.3.0/gems/activesupport-7.2.1/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
# /usr/local/bundle/ruby/3.3.0/gems/activesupport-7.2.1/lib/active_support/lazy_load_hooks.rb:62:in `block in on_load'
# /usr/local/bundle/ruby/3.3.0/gems/activesupport-7.2.1/lib/active_support/lazy_load_hooks.rb:61:in `each'
# /usr/local/bundle/ruby/3.3.0/gems/activesupport-7.2.1/lib/active_support/lazy_load_hooks.rb:61:in `on_load'
# /usr/local/bundle/ruby/3.3.0/gems/railties-7.2.1/lib/rails/railtie/configuration.rb:71:in `after_initialize'
# /usr/local/bundle/ruby/3.3.0/gems/yabeda-0.12.0/lib/yabeda/railtie.rb:6:in `<class:Railtie>'
# /usr/local/bundle/ruby/3.3.0/gems/yabeda-0.12.0/lib/yabeda/railtie.rb:5:in `<module:Rails>'
# /usr/local/bundle/ruby/3.3.0/gems/yabeda-0.12.0/lib/yabeda/railtie.rb:4:in `<module:Yabeda>'
# /usr/local/bundle/ruby/3.3.0/gems/yabeda-0.12.0/lib/yabeda/railtie.rb:3:in `<top (required)>'
# /usr/local/bundle/ruby/3.3.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:in `require'
# /usr/local/bundle/ruby/3.3.0/gems/yabeda-0.12.0/lib/yabeda.rb:11:in `<top (required)>'

@bibendi
Copy link
Contributor Author

bibendi commented Sep 13, 2024

@Envek

@Envek Envek merged commit 1af0fff into yabeda-rb:master Oct 1, 2024
3 of 5 checks passed
Envek added a commit to Keallar/yabeda that referenced this pull request Oct 1, 2024
* master:
  Switch to RubyGems Trusted publishing in CI release workflow [ci skip]
  Update CI for rubocop and fix lint issues
  fix: railtie loading to prevent calling methods that have not yet been defined (yabeda-rb#38)
@Envek
Copy link
Member

Envek commented Oct 2, 2024

Released in 0.13.0, 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.

2 participants