Skip to content

Commit

Permalink
Merge pull request #447 from datacite/csv-export-changes
Browse files Browse the repository at this point in the history
Csv export changes
  • Loading branch information
Martin Fenner authored Mar 7, 2020
2 parents 20fb28c + c94ba57 commit 911ccb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/export_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def organizations
accountName: provider.name,
fabricaAccountId: provider.symbol,
parentFabricaAccountId: provider.consortium.present? ? provider.consortium.symbol : nil,
isActive: provider.is_active == "\x01",
isActive: provider.deleted_at.blank?,
accountDescription: provider.description,
accountWebsite: provider.website,
region: provider.region_human_name,
Expand Down Expand Up @@ -257,7 +257,7 @@ def repositories
accountName: name,
fabricaAccountId: client.symbol,
parentFabricaAccountId: client.provider.present? ? client.provider.symbol : nil,
isActive: client.is_active == "\x01",
isActive: client.deleted_at.blank?
accountDescription: client.description,
accountWebsite: client.url,
generalContactEmail: client.system_email,
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def query(query, options={})
must << { term: { opendoar_id: options[:opendoar_id] }} if options[:opendoar_id].present?
must << { term: { client_type: options[:client_type] }} if options[:client_type].present?
must_not << { exists: { field: "deleted_at" }} unless options[:include_deleted]
must_not << { terms: { provider_id: ["crossref", "medra", "op"] }} if options[:exclude_registration_agencies]
must_not << { terms: { symbol: !%w(CROSSREF.CITATIONS MEDRA.CITATIONS JALC.CITATIONS KISTI.CITATIONS OP.CITATIONS) }} if options[:exclude_registration_agencies]
elsif self.name == "Doi"
must << { terms: { aasm_state: options[:state].to_s.split(",") }} if options[:state].present?
must << { range: { registered: { gte: "#{options[:registered].split(",").min}||/y", lte: "#{options[:registered].split(",").max}||/y", format: "yyyy" }}} if options[:registered].present?
Expand All @@ -243,7 +243,7 @@ def query(query, options={})
must << { term: { "client.re3data_id" => options[:re3data_id].gsub("/", '\/').upcase }} if options[:re3data_id].present?
must << { term: { "client.opendoar_id" => options[:opendoar_id] }} if options[:opendoar_id].present?
must << { terms: { "client.certificate" => options[:certificate].split(",") }} if options[:certificate].present?
must_not << { terms: { provider_id: ["crossref", "medra", "op"] }} if options[:exclude_registration_agencies]
must_not << { terms: { "client.symbol" => !%w(CROSSREF.CITATIONS MEDRA.CITATIONS JALC.CITATIONS KISTI.CITATIONS OP.CITATIONS) }} if options[:exclude_registration_agencies]
elsif self.name == "Event"
must << { term: { subj_id: URI.decode(options[:subj_id]) }} if options[:subj_id].present?
must << { term: { obj_id: URI.decode(options[:obj_id]) }} if options[:obj_id].present?
Expand Down

0 comments on commit 911ccb2

Please sign in to comment.