Skip to content

Commit

Permalink
Do not reload rake tasks when under add-on environment
Browse files Browse the repository at this point in the history
Co-authored-by: Andy Waite <[email protected]>
  • Loading branch information
vinistock and andyw8 committed Nov 21, 2024
1 parent f713fdf commit 3ce0a60
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/tapioca/dsl/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,14 @@ def report_error(error)

sig { void }
def abort_if_pending_migrations!
# When running within the add-on, we cannot invoke the abort if pending migrations task because that will exit
# the process and crash the Rails runtime server. Instead, the Rails add-on checks for pending migrations and
# warns the user, so that they are aware they need to migrate their database
return if @lsp_addon
return unless defined?(::Rake)

Rails.application.load_tasks

if Rake::Task.task_defined?("db:abort_if_pending_migrations")
Rake::Task["db:abort_if_pending_migrations"].invoke
end
Expand Down

0 comments on commit 3ce0a60

Please sign in to comment.