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

Autoload Activejob::Arguments #33234

Merged
merged 2 commits into from
Jun 27, 2018

Conversation

alpaca-tc
Copy link
Contributor

Summary

Currently, initial rails console can't load ActiveJob::Arguments.

$ ./bin/rails console
> ActiveJob::Arguments.serialize(...)
NameError: uninitialized constant ActiveJob::Arguments

It is inconvenient for me because I want to check the behavior from the console.

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @schneems (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

@alpaca-tc alpaca-tc changed the title Autoload activejob arguments Autoload Activejob::Arguments Jun 27, 2018
@kamipo kamipo merged commit cb0fdaa into rails:master Jun 27, 2018
@y-yagi
Copy link
Member

y-yagi commented Jun 27, 2018

Activejob::Arguments is not a public API. Why would you want to use it directly?

@kamipo
Copy link
Member

kamipo commented Jun 27, 2018

I regarded this PR as the fixing dependency.
ActiveJob::Arguments is used internaly in some files (e.g. Core, TestHelper), but looks like these doesn't work unless after ActiveJob::Base is loaded (ActiveJob::Base requires active_job/enqueuing and active_job/execution which includes require "active_job/arguments").

@alpaca-tc alpaca-tc deleted the autoload_activejob_arguments branch June 27, 2018 10:08
@rafaelfranca
Copy link
Member

Yeah, this PR make sense only because we were missing the requires in but now it seems broken because Arguments will not be eagerloaded when the application is eagerloaded. We need to fix that.

@rafaelfranca
Copy link
Member

Probably that is also a problem with Serializers and other constants, we need to review the eager loading of Active Job.

kaspth added a commit that referenced this pull request Jul 1, 2018
…rguments"

It breaks Active Job when run in isolation. E.g. bin/test test/cases/logging_test.rb:
https://travis-ci.org/rails/rails/jobs/398779028

Consider Rafaels suggestion of reviewing the eager loading instead:
#33234 (comment)

This reverts commit cb0fdaa, reversing
changes made to a0a1abb.
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.

None yet

6 participants