module Fiona7 class ComplexObject def initialize(obj) @obj = obj end def widgets # TODO: optimize this through attr_values links = @obj[:X_widget_pool] || [] WriteObj.where(obj_id: links.map {|l| l.destination_object_id }).to_a.to_set end def binaries type_definition = Fiona7::TypeRegister.instance.read_mangled(@obj.obj_class) type_definition.attrs.each do |attribute| if attribute.type == :binary && attribute.real_name != "blob" (obj[attribute.real_name] || []).each do |link| referenced << link.destination_object end end end end end end