desc "attach_resources DATA, FIELD", "attach resource ref to object by matching values from the given field. assumes DATA is an array of hashes, FIELD is a string"
def attach_resources(data,field)
index = execute "common:objects:make_index_resources"
data.each do |record|
# record[field].each {|entity| subjects_refs << index[entity]}
record["resource__ref"] = index[record[field]]
end
data
end