Skip to content

Commit 46626e4

Browse files
committed
refactor: avoid exposing to_h in configuration
1 parent 5fb2df2 commit 46626e4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/inertia_rails/configuration.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ def freeze
3737
super
3838
end
3939

40-
def to_h
41-
@options.to_h
42-
end
43-
4440
def merge!(config)
4541
@options.merge!(config.options)
4642
self

spec/dummy/app/controllers/inertia_config_test_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class InertiaConfigTestController < ApplicationController
44
ssr_enabled: true,
55
ssr_url: "http://localhost:7777",
66
layout: "test",
7-
version: "2.0",
7+
version: "1.0",
88
)
99

1010
# Test that modules included in the same class can also call it.
@@ -13,6 +13,6 @@ class InertiaConfigTestController < ApplicationController
1313
)
1414

1515
def configuration
16-
render json: inertia_configuration.to_h
16+
render json: inertia_configuration.send(:options)
1717
end
1818
end

0 commit comments

Comments
 (0)