forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix primary_abstract_class with engines
With engines this would result in an error because there can only be one `primary_abstract_class`. This is the class that your app connects to on boot when it's connecting lazily and you're using multiple databases. This change just removes `primary_abstract_class` from the engine `ApplicationRecord` classes and keeps them as `self.abstract_class = true`. Fixes rails#43247
- Loading branch information
1 parent
f2be2b0
commit 9c72186
Showing
2 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...s/generators/rails/plugin/templates/app/models/%namespaced_name%/application_record.rb.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<%= wrap_in_modules <<~rb | ||
class ApplicationRecord < ActiveRecord::Base | ||
primary_abstract_class | ||
self.abstract_class = true | ||
end | ||
rb | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters