Revert "Merge pull request #48527 from ghiculescu/active-record-enum-id" #48534
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Railties tests have been failing since this change. The issue is that calling
primary_key
as the model is loaded requires either a connection to the database or a populated schema cache. This becomes an issue when an app loads models that do not have underlying tables, as shown in the failing Railties tests.When eager loading an app using
rails/all
,ActionMailbox::InboundEmail
will be loaded whether or notrails g action_mailbox:install
has been run. This means theprimary_key
forInboundEmail
will not be in the schema cache and a database connection will be required to boot the app.Detail
This reverts commit 8b36095, reversing changes made to e05245d.
Additional information
Example failures:
Ref #48524
Ref #48527
cc @ghiculescu @guilleiguaran