Skip to content

Commit 52b5c9d

Browse files
committed
Don't call check_all_pending! for older Rails
1 parent a89f3a2 commit 52b5c9d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/ruby_lsp/ruby_lsp_rails/server.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ def active_record_model?(const)
259259
end
260260

261261
def pending_migrations_message
262-
return unless defined?(ActiveRecord)
262+
# `check_all_pending!` is only available since Rails 7.1
263+
return unless defined?(ActiveRecord) && ActiveRecord::Migration.respond_to?(:check_all_pending!)
263264

264265
ActiveRecord::Migration.check_all_pending!
265266
nil

0 commit comments

Comments
 (0)