We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d787029 + b4264a5 commit 93a846aCopy full SHA for 93a846a
lib/active_admin/views/components/attributes_table.rb
@@ -5,7 +5,7 @@ class AttributesTable < ActiveAdmin::Component
5
builder_method :attributes_table_for
6
7
def build(obj, *attrs)
8
- @collection = is_array?(obj) ? obj : [obj]
+ @collection = Array.wrap(obj)
9
@resource_class = @collection.first.class
10
options = { }
11
options[:for] = @collection.first if single_record?
@@ -102,10 +102,6 @@ def reflection_for(klass, method)
102
def single_record?
103
@single_record ||= @collection.size == 1
104
end
105
-
106
- def is_array?(obj)
107
- obj.respond_to?(:each) && obj.respond_to?(:first) && !obj.is_a?(Hash)
108
- end
109
110
111
0 commit comments