Add and apply Style/KeywordArgumentsMerging rubocop rule

This rule was introduced in RuboCop 1.68 to encourage passing
additional keyword arguments directly instead of using merge.
This commit is contained in:
taitus
2025-02-13 10:48:16 +01:00
parent ada35f51f2
commit 9081174dd7
4 changed files with 7 additions and 4 deletions

View File

@@ -15,6 +15,6 @@ class Admin::AllowedTableActionsComponent < ApplicationComponent
end
def table_actions_component
@table_actions_component ||= Admin::TableActionsComponent.new(record, **options.merge(actions: actions))
@table_actions_component ||= Admin::TableActionsComponent.new(record, **options, actions: actions)
end
end

View File

@@ -2,10 +2,10 @@
<%= content %>
<% if actions.include?(:edit) %>
<%= action(:edit, **edit_options.merge(text: edit_text, path: edit_path)) %>
<%= action(:edit, **edit_options, text: edit_text, path: edit_path) %>
<% end %>
<% if actions.include?(:destroy) %>
<%= action(:destroy, **destroy_options.merge(text: destroy_text, path: destroy_path)) %>
<%= action(:destroy, **destroy_options, text: destroy_text, path: destroy_path) %>
<% end %>
</div>