Skip to content

Commit

Permalink
minor fixes for 2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jambun committed Sep 26, 2017
1 parent 358fda5 commit 027c459
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/controllers/download_accessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class DownloadAccessionsController < ApplicationController
set_access_control "view_repository" => [:download]

def download
download_params = params_for_backend_search.merge('aq' => params['aq'])
download_params = params_for_backend_search.merge('aq' => params['aq'], 'type[]' => 'accession')

# things changed in v2.0.0
build_filters(download_params) unless ASConstants.VERSION.start_with?('v1')
Expand Down
5 changes: 3 additions & 2 deletions indexer/indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ class CommonIndexer
indexer.add_document_prepare_hook {|doc, record|
if doc['primary_type'] == 'accession'
ASUtils.wrap(record['record']['linked_events']).each{|linked_event|
event = JSONModel::JSONModel(:event).find(JSONModel.parse_reference(linked_event['ref'])[:id])
event = JSONModel::JSONModel(:event).find(JSONModel.parse_reference(linked_event['ref'])[:id],
:repo_id => record['record']['repository']['ref'].sub(/.*\//, ''))
doc["event_#{event['event_type']}_u_sstr"] = event['outcome']
doc["event_#{event['event_type']}_begin_u_sstr"] = event['date']['begin']
doc["event_#{event['event_type']}_begin_u_sstr"] = event['date']['begin'] if event['date']
}
end
}
Expand Down

0 comments on commit 027c459

Please sign in to comment.