lib/cultural_network/import/feature_data.rb
# ##################################################################### #
# Given an hpricot snippet and a citable object, extract the citations
# from the hpricot, create them in the db, and attach them to the object
Given an hpricot snippet and a citable object, extract the citations
from the hpricot, create them in the db, and attach them to the object
Given an hpricot snippet and a citable object extract the citations from the hpricot create them in the db and attach them to the object
def extract_citations(doc, object)
      authorities = (doc/'/authority')
      authorities.each do |authority|
        is = Document.find(authority.inner_text)
        cit = Citation.create(:info_source_id => is.id, :citable=> object)
      end
    end
def extract_citations ( doc , object ) authorities = ( doc / '/authority' ) authorities . each do | authority | is = Document . find ( authority . inner_text ) cit = Citation . create ( :info_source_id => is . id , :citable => object ) end end
Given an hpricot snippet and a citable object, extract the citations
from the hpricot, create them in the db, and attach them to the object
Given an hpricot snippet and a citable object extract the citations from the hpricot create them in the db and attach them to the object
doc
<not_specific>
object
<not_specific>