app/models/hierarchy/concept_merger.rb
# NOTE: we could query the DB to buld this full list, using
# TaxonConcept.superceded. It takes about 30 seconds, and returns 32M
# results (as of this writing). ...We don't need all of them, though, so
# doing this does potentially save us a bit of time.... I think. I guess it
# depends on how many TaxonConcepts we call #find for. TODO: we could just
# have a "supercedure" table. ...That would actually be pretty handy, though
# it would be another case of having to pay attention to a denormalized
# table, and I'm not sure it's worth that, either. Worth checking, I
# suppose.
we could query the DB to buld this full list, using
TaxonConcept.superceded. It takes about 30 seconds, and returns 32M
results (as of this writing). ...We don't need all of them, though, so
doing this does potentially save us a bit of time.... I think. I guess it
depends on how many TaxonConcepts we call #find for. TODO: we could just
have a "supercedure" table. ...That would actually be pretty handy, though
it would be another case of having to pay attention to a denormalized
table, and I'm not sure it's worth that, either. Worth checking, I
suppose.
we could query the DB to buld this full list using TaxonConcept . superceded . It takes about 30 seconds and returns 32M results ( as of this writing ) . ... We don ' t need all of them though so doing this does potentially save us a bit of time .... I think . I guess it depends on how many TaxonConcepts we call #find for . TODO : we could just have a " supercedure " table . ... That would actually be pretty handy though it would be another case of having to pay attention to a denormalized table and I ' m not sure it ' s worth that either . Worth checking I suppose .
def follow_supercedure_cached(id)
      new_id = if @superceded.has_key?(id) && @superceded[id] != 0
        @superceded[id]
      else
        follow_supercedure(id)
      end
      while @superceded.has_key?(new_id) && @superceded[id] != 0
        new_id = @superceded[new_id]
      end
      new_id
    end
def follow_supercedure_cached ( id ) new_id = if @superceded . has_key? ( id ) && @superceded [ id ] != 0 @superceded [ id ] else follow_supercedure ( id ) end while @superceded . has_key? ( new_id ) && @superceded [ id ] != 0 new_id = @superceded [ new_id ] end new_id end
NOTE: we could query the DB to buld this full list, using
TaxonConcept.superceded.
NOTE : we could query the DB to buld this full list using TaxonConcept . superceded .
id
<not_specific>