Skip to content

[ActiveRecord] Fix DB connection issues during assets:precompile#3470

Merged
mshibuya merged 1 commit into
railsadminteam:masterfrom
codealchemy:non-db-action-connection-issues
Feb 15, 2022
Merged

[ActiveRecord] Fix DB connection issues during assets:precompile#3470
mshibuya merged 1 commit into
railsadminteam:masterfrom
codealchemy:non-db-action-connection-issues

Conversation

@codealchemy

@codealchemy codealchemy commented Feb 14, 2022

Copy link
Copy Markdown
Contributor

Closes #3469

When initializing abstract (ActiveRecord) models, #table_exists? is used and calls through the connection, which (in the case of a precompile step) can raise errors other than the ActiveRecord::NoDatabaseError that's currently handled.

I believe this should cover all PostgreSQL and MySQL connection errors handled by Rails.

When initializing abstract (ActiveRecord) models, #table_exists? is used and calls through the connection, which (in the case of a precompile step) can raise errors other than the ActiveRecord::NoDatabaseError that's currently handled.
@coveralls

coveralls commented Feb 14, 2022

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 1843895617

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.889%

Totals Coverage Status
Change from base Build 1834034935: 0.0%
Covered Lines: 3685
Relevant Lines: 3843

💛 - Coveralls

@mshibuya mshibuya merged commit d96def6 into railsadminteam:master Feb 15, 2022
@mshibuya

Copy link
Copy Markdown
Member

Looks great, thanks 🙌

@ha4gu

ha4gu commented Feb 15, 2022

Copy link
Copy Markdown

Now bin/rails assets:precompile works, thank you so much!

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.

3.0.0.rc try to access to the database when asset precompiling if it has config.model configuration

4 participants