File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
app/controllers/ruby_lsp/rails
test/controllers/ruby_lsp_rails Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class ModelsController < ApplicationController
8
8
9
9
sig { returns ( T . untyped ) }
10
10
def show
11
- const = Object . const_get ( params [ :id ] ) # rubocop:disable Sorbet/ConstantsFromStrings
11
+ const = Object . const_get ( params [ :model ] ) # rubocop:disable Sorbet/ConstantsFromStrings
12
12
13
13
begin
14
14
schema_file = ActiveRecord ::Tasks ::DatabaseTasks . schema_dump_path ( const . connection . pool . db_config )
Original file line number Diff line number Diff line change 2
2
# frozen_string_literal: true
3
3
4
4
RubyLsp ::Rails ::Engine . routes . draw do
5
- resources :models , only : [ :show ]
5
+ resources :models , only : [ :show ] , param : :model
6
6
end
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class ModelsControllerTest < ActionDispatch::IntegrationTest
9
9
T . unsafe ( self ) . include ( Engine . routes . url_helpers )
10
10
11
11
test "GET show returns column information for existing models" do
12
- get model_url ( id : "User" )
12
+ get model_url ( model : "User" )
13
13
assert_response ( :success )
14
14
assert_equal (
15
15
{
@@ -28,12 +28,12 @@ class ModelsControllerTest < ActionDispatch::IntegrationTest
28
28
end
29
29
30
30
test "GET show returns not_found if model doesn't exist" do
31
- get model_url ( id : "NonExistentModel" )
31
+ get model_url ( model : "NonExistentModel" )
32
32
assert_response ( :not_found )
33
33
end
34
34
35
35
test "GET show returns not_found if class is not a model" do
36
- get model_url ( id : "ApplicationJob" )
36
+ get model_url ( model : "ApplicationJob" )
37
37
assert_response ( :not_found )
38
38
end
39
39
end
You can’t perform that action at this time.
0 commit comments