lib/avo/fields/field_manager.rb in avo-3.0.0.beta1 vs lib/avo/fields/field_manager.rb in avo-3.0.0.pre1
- old
+ new
@@ -9,26 +9,16 @@
end
end
attr_reader :fields
+ alias_method :all, :fields
+
def initialize
@fields = []
end
- def all
- fields
- .map do |field|
- field[:name] = field[:name].to_s
-
- field
- end
- .uniq do |field|
- field[:name]
- end
- end
-
# This method will find all fields available in the Avo::Fields namespace and add them to the fields class_variable array
# so later we can instantiate them on our resources.
#
# If the field has their `def_method` set up it will follow that convention, if not it will snake_case the name:
#
@@ -44,10 +34,10 @@
end
end
def load_field(method_name, klass)
fields.push(
- name: method_name.to_s,
+ name: method_name,
class: klass
)
end
end
end