From 9aa242918dad4d2ce956f2cbb3f70ead734c4a24 Mon Sep 17 00:00:00 2001 From: Nachiket Pusalkar <33430835+nachiket87@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:52:09 -0500 Subject: [PATCH] fix duplicate controllers in manifest on update --- lib/stimulus/manifest.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/stimulus/manifest.rb b/lib/stimulus/manifest.rb index 3f8d6ec..d944d20 100644 --- a/lib/stimulus/manifest.rb +++ b/lib/stimulus/manifest.rb @@ -2,9 +2,11 @@ module Stimulus::Manifest extend self def generate_from(controllers_path) - extract_controllers_from(controllers_path).collect do |controller_path| + manifest = extract_controllers_from(controllers_path).collect do |controller_path| import_and_register_controller(controllers_path, controller_path) end + + manifest.uniq end def import_and_register_controller(controllers_path, controller_path)