Skip to content

Commit c3464a7

Browse files
committed
Removing uneccessary args extraction. Just accept options.
1 parent 80636de commit c3464a7

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

lib/active_admin/views/components/batch_action_form.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ class BatchActionForm < ActiveAdmin::Component
66

77
attr_reader :prefix_html
88

9-
def build(*args, &block)
10-
options = args.extract_options!
9+
def build(options = {}, &block)
1110
options[:id] ||= "collection_selection"
1211
@contents = input(:name => :batch_action, :id => :batch_action, :type => :hidden)
1312
@prefix_html = text_node(form_tag active_admin_config.batch_action_path, :id => options[:id])

lib/active_admin/views/components/batch_action_popover.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ module Views
55
# Build an BatchActionPopover
66
class BatchActionPopover < ActiveAdmin::Views::ActionListPopover
77
builder_method :batch_action_popover
8-
9-
def build(*args, &block)
10-
options = args.extract_options!
8+
9+
def build(options = {}, &block)
1110
options[:id] ||= "batch_actions_popover"
1211
super(options)
1312
end
14-
15-
def action(batch_action, *args)
16-
options = args.extract_options!
13+
14+
def action(batch_action, options = {})
1715
options[:class] ||= []
1816
options[:class] += %w(batch_action)
1917
super( "%s Selected" % batch_action.title, "#", options.merge( "data-action" => batch_action.sym, "data-confirm" => batch_action.confirm ) )

lib/active_admin/views/components/popover.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ def default_class_name
88
'popover'
99
end
1010

11-
def build(*args, &block)
12-
13-
options = args.extract_options!
11+
def build(options = {}, &block)
1412

1513
self.id = options[:id]
1614

@@ -33,4 +31,4 @@ def add_child(child)
3331

3432
end
3533
end
36-
end
34+
end

0 commit comments

Comments
 (0)