Skip to content

Commit

Permalink
Refactor - constistency, make stimulus_controllers accept string inst…
Browse files Browse the repository at this point in the history
…ead of array

In the implementation for resources we're using string. I'm not convinced that this is a right approach, but I'm applying same convention here.
  • Loading branch information
bryszard committed Nov 19, 2023
1 parent 829a69b commit 4211289
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/avo/concerns/has_action_stimulus_controllers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module HasActionStimulusControllers
extend ActiveSupport::Concern

included do
class_attribute :stimulus_controllers, default: []
class_attribute :stimulus_controllers, default: ""
end

def get_stimulus_controllers
self.class.stimulus_controllers.join " "
self.class.stimulus_controllers
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/app/avo/actions/show_current_time.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class ShowCurrentTime < Avo::BaseAction
self.name = "Show current time"
self.standalone = true
self.stimulus_controllers = ["city-in-country"]
self.stimulus_controllers = "city-in-country"

field :country,
as: :select,
Expand Down

0 comments on commit 4211289

Please sign in to comment.