Class: DigitalAssetLookupService

Inherits:
Object
  • Object
show all
Defined in:
app/service/digital_asset_lookup_service.rb

Class Method Summary collapse

Class Method Details

.fund_code_from_id(taxonomy_id) ⇒ Object

def self.find_documents_by_fund_code_and_content_type(fund_codes,content_type)

assets = DigitalAssetLookupService.find_documents_by_fund_code(fund_codes)
found_asset = nil
assets.each {|da|
  da.documents.each {|doc|
    found_asset = da if doc.content_type == content_type
  }
}
found_asset

end



19
20
21
# File 'app/service/digital_asset_lookup_service.rb', line 19

def self.fund_code_from_id(taxonomy_id)
  TaxonomyTerm.term_id_is(taxonomy_id).first.try(:term_type).try(:[], 'FUND_CODE')
end