app/models/media_association.rb
# It's okay to truncate the table here, because it doesn't affect anything in
# production; we only use this (now) as a kind of temp table to avoid a bunch
# of work, and eventually rebuild top_images (which itself just goes into a
# Solr Core and isn't used on the site!)
It's okay to truncate the table here, because it doesn't affect anything in
production; we only use this (now) as a kind of temp table to avoid a bunch
of work, and eventually rebuild top_images (which itself just goes into a
Solr Core and isn't used on the site!)
It ' s okay to truncate the table here because it doesn ' t affect anything in production ; we only use this ( now ) as a kind of temp table to avoid a bunch of work and eventually rebuild top_images ( which itself just goes into a Solr Core and isn ' t used on the site! )
def rebuild
      EOL::Db.truncate_table(MediaAssociation.connection, :media_associations)
      fields = [:hierarchy_entry_id, :data_object_id, :rating, :visible, :preview,
        :vet_sort, :published]
      assocs = {}
      merge_associations_from_table(assocs, DataObjectsHierarchyEntry)
      merge_associations_from_table(assocs, CuratedDataObjectsHierarchyEntry)
      data = build_ancestors(assocs)
      EOL::Db.bulk_insert(MediaAssociation, fields, data)
    end
def rebuild EOL :: Db . truncate_table ( MediaAssociation . connection , :media_associations ) fields = [ :hierarchy_entry_id , :data_object_id , :rating , :visible , :preview , :vet_sort , :published ] assocs = { } merge_associations_from_table ( assocs , DataObjectsHierarchyEntry ) merge_associations_from_table ( assocs , CuratedDataObjectsHierarchyEntry ) data = build_ancestors ( assocs ) EOL :: Db . bulk_insert ( MediaAssociation , fields , data ) end
It's okay to truncate the table here, because it doesn't affect anything in
production; we only use this (now) as a kind of temp table to avoid a bunch
of work, and eventually rebuild top_images (which itself just goes into a
Solr Core and isn't used on the site!)
It ' s okay to truncate the table here because it doesn ' t affect anything in production ; we only use this ( now ) as a kind of temp table to avoid a bunch of work and eventually rebuild top_images ( which itself just goes into a Solr Core and isn ' t used on the site! )