libraries/AssociationManagement.rb
# Retrieves part_data from the data associations of constituent parts.
# achieves forward compatibility with AQ Part update
Retrieves part_data from the data associations of constituent parts.
achieves forward compatibility with AQ Part update
Retrieves part_data from the data associations of constituent parts . achieves forward compatibility with AQ Part update
def data_matrix_all(coll, data_matrix)
      pas = coll.part_associations
      part_ids = pas.collect(&:part_id)
      das = DataAssociation.where(parent_class: 'Item', parent_id: part_ids)
      pas.each do |pa|
        data_matrix[pa.row][pa.column] = {}
        das.select { |da| da.parent_id == pa.part_id }.each do |da|
          data_matrix[pa.row][pa.column][da.key] = da.value
        end
      end
      data_matrix
    end
def data_matrix_all ( coll , data_matrix ) pas = coll . part_associations part_ids = pas . collect ( & :part_id ) das = DataAssociation . where ( parent_class : 'Item' , parent_id : part_ids ) pas . each do | pa | data_matrix [ pa . row ] [ pa . column ] = { } das . select { | da | da . parent_id == pa . part_id } . each do | da | data_matrix [ pa . row ] [ pa . column ] [ da . key ] = da . value end end data_matrix end
Retrieves part_data from the data associations of constituent parts.
Retrieves part_data from the data associations of constituent parts .
coll
data_matrix