lib/avo/base_resource.rb in avo-2.21.0 vs lib/avo/base_resource.rb in avo-2.21.1.pre.issue1444
- old
+ new
@@ -115,13 +115,12 @@
name == association_name
end
end
def valid_attachment_name(record, association_name)
- association_exists = get_record_associations(record).keys.any? do |name|
- name == "#{association_name}_attachment" || name == "#{association_name}_attachments"
+ get_record_associations(record).keys.each do |name|
+ return association_name if name == "#{association_name}_attachment" || name == "#{association_name}_attachments"
end
- return association_name if association_exists
end
def get_available_models
ApplicationRecord.descendants
end