lib/taxon_concept_builder.rb
# There isn't much involved with the actual TaxonConcept, in terms of the database and/or generation of the model
# itself.  It's basically just an ID which is either published/vetted or not.
#
# That said, sometimes, we want a particular ID, so this method includes a little hacking to get that done.
There isn't much involved with the actual TaxonConcept, in terms of the database and/or generation of the model
itself.  It's basically just an ID which is either published/vetted or not.

That said, sometimes, we want a particular ID, so this method includes a little hacking to get that done.
There isn ' t much involved with the actual TaxonConcept in terms of the database and / or generation of the model itself . It ' s basically just an ID which is either published / vetted or not . That said sometimes we want a particular ID so this method includes a little hacking to get that done .
def gen_taxon_concept
    puts "** Enter: gen_taxon_concept" if @debugging
    vetted = Vetted.send(@vetted.to_sym)
    if @id
      @tc = TaxonConcept.find(@id) rescue nil
      if @tc.nil?
        @tc = TaxonConcept.gen(:vetted => vetted)
        TaxonConcept.connection.execute("UPDATE taxon_concepts SET id = #{@id} WHERE id = #{@tc.id}")
        @tc = TaxonConcept.find(@id)
      end
      @tc = @tc.first if @tc.class == Array  
    else
      @tc = TaxonConcept.gen(:vetted => vetted)
      @id = @tc.id
    end
  end
def gen_taxon_concept puts "** Enter: gen_taxon_concept" if @debugging vetted = Vetted . send ( @vetted . to_sym ) if @id @tc = TaxonConcept . find ( @id ) rescue nil if @tc . nil? @tc = TaxonConcept . gen ( :vetted => vetted ) TaxonConcept . connection . execute ( "UPDATE taxon_concepts SET id = #{@id} WHERE id = #{@tc.id}" ) @tc = TaxonConcept . find ( @id ) end @tc = @tc . first if @tc . class == Array else @tc = TaxonConcept . gen ( :vetted => vetted ) @id = @tc . id end end
There isn't much involved with the actual TaxonConcept, in terms of the database and/or generation of the model
itself.
There isn ' t much involved with the actual TaxonConcept in terms of the database and / or generation of the model itself .
# TODO - in the future, we may want to be able to muck with the vetted *and* the published fields... # HACK!  We need to force the IDs of one of the TaxonConcepts, so that the exmplar array isn't empty.  I # hate to do it this way, but, alas, this is how it currently works: # TODO - why in the WORLD is this an array?  ...but it is...