app/models/toc_item.rb
# TODO - sure, we can code this with english labels, but it should STORE ids.
sure, we can code this with english labels, but it should STORE ids.
sure we can code this with english labels but it should STORE ids .
def synonyms
      InfoItem
      cached('synonyms') do
        r = TocItem.find_all_by_parent_id(self.name_and_taxonomy.id, include: [ :info_items, { parent: :info_items } ]).select{ |t| t.label('en') == 'Synonyms' }
        r.blank? ? nil : r[0]
      end
    end
def synonyms InfoItem cached ( 'synonyms' ) do r = TocItem . find_all_by_parent_id ( self . name_and_taxonomy . id , include : [ :info_items , { parent : :info_items } ] ) . select { | t | t . label ( 'en' ) == 'Synonyms' } r . blank? ? nil : r [ 0 ] end end
TODO - sure, we can code this with english labels, but it should STORE ids.
TODO - sure we can code this with english labels but it should STORE ids .