Skip to content

Commit 192ccfb

Browse files
authored
Merge pull request #2589 from ViewComponent/copilot/remove-require-dependency
Replace deprecated `require_dependency` with `require` in preview loading
2 parents eacb45a + 6ac4927 commit 192ccfb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 6
1010

1111
## main
1212

13+
* Replace deprecated `require_dependency` with `require` in preview loading.
14+
15+
*GitHub Copilot*
16+
1317
* Return `html_safe` empty string from `render_in` when `render?` is false.
1418

1519
*Copilot*

lib/view_component/preview.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def preview_example_template_path(example)
9595
# @private
9696
def __vc_load_previews
9797
Array(preview_paths).each do |preview_path|
98-
Dir["#{preview_path}/**/*preview.rb"].sort.each { |file| require_dependency file }
98+
Dir["#{preview_path}/**/*preview.rb"].sort.each { |file| require file }
9999
end
100100
end
101101

0 commit comments

Comments
 (0)