Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Shopify/ruby-lsp-rails
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7ed3715ff43af2208897bb680889f4a108eeb1d2
Choose a base ref
..
head repository: Shopify/ruby-lsp-rails
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f7643cdee181c97bedd714282cad513f60ff5c15
Choose a head ref
Showing with 1,077 additions and 2 deletions.
  1. +10 −2 lib/ruby_lsp/ruby_lsp_rails/server.rb
  2. +1,065 −0 sorbet/rbi/gems/activerecord@8.0.0.rbi
  3. +2 −0 sorbet/tapioca/require.rb
12 changes: 10 additions & 2 deletions lib/ruby_lsp/ruby_lsp_rails/server.rb
Original file line number Diff line number Diff line change
@@ -3,7 +3,15 @@

require "json"
require "open3"
require "rails/test_help" # to determine the fixture_paths

# to determine the fixture_paths
if defined?(ActiveRecord::Base)
ActiveSupport.on_load(:active_support_test_case) do
include ActiveRecord::TestFixtures

fixture_paths << "#{Rails.root}/test/fixtures/"
end
end

module RubyLsp
module Rails
@@ -124,7 +132,7 @@ def initialize(stdout: $stdout, override_default_output_device: true)
def start
load_routes
clear_file_system_resolver_hooks
# `fixtures_paths` is only available in Rails 7.1 and later
# `fixtures_path` is only available in Rails 7.1 and later
# Prior to that it used `fixture_path` which we do not support.
fixtures_paths = ActiveSupport::TestCase.fixture_paths if ActiveSupport::TestCase.respond_to?(:fixture_paths)

Loading