*** oddb.org/src/model/substance.rb 2011-12-01 07:22:15.978497632 +0100 --- substance.rb 2011-12-01 10:15:35.882334411 +0100 *************** *** 195,205 **** end def name # First call to descriptions should go to lazy-initialisator ! if(lt = self.descriptions['lt']) && !lt.empty? ! lt ! else ! @descriptions['en'].to_s end end alias :pointer_descr :name def names --- 195,213 ---- end def name # First call to descriptions should go to lazy-initialisator ! #if(lt = self.descriptions['lt']) && !lt.empty? ! if descrs = self.descriptions and lt = descrs['lt'] and !lt.empty? ! lt.to_s ! elsif @descriptions and en = @descriptions['en'] ! en.to_s ! else ! '' end + rescue => e + @@name_error_count ||= 0 + @@name_error_count += 1 + warn "#{@@name_error_count}, ODDB::Substance#descriptions error: Substance#odba_id = #{self.odba_id}" + '' end alias :pointer_descr :name def names