qa_server 3.0.3 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7909aaa8ddc9c7cb6b0e5f71d846c8428bd7c132
4
- data.tar.gz: 7c1a5c17fc150d7334422e7387a67530ae02ce54
3
+ metadata.gz: 37f80125e57ee5bc9e3f514c08d24715f5e81b98
4
+ data.tar.gz: 10bd3168e22d83820fc4c89744cc38e08f9cd45c
5
5
  SHA512:
6
- metadata.gz: a9912f7ba243ec186ccc54b48498d3d0e734ccda08fe7618051d4f3d073dde53ffea8cea5018bdfe2b3a6cabcd95b4d3843f5098f9a5ee49cdd716dabd8eb845
7
- data.tar.gz: a06700826ab8dbba99934405542bbfdefd180b75480280ddd2ff1dcb44d0802085268b502de2dfd9c7a4c1e2531b7d8f793f3893b8a9a476d33f54daf54f73f0
6
+ metadata.gz: f9e26c3328a01817e3e2a5f008d17ac6f83e8585bd80a1fef85b9ba59c1d92925daff2c512da26d22016fd2f61bc3a7f2508501b7be498ba587798f0fabf966d
7
+ data.tar.gz: 6f58a918e2b80fd025911c4af22458b2d240dcbdc2c31eaecaf2f34cc2fa27343c7c201631b528f956d2e04f68f3fae3549000cc6bebb47b90ca3030f4b993a6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 4.0.0 (2019-11-14)
2
+
3
+ * prepends for find and query updated to process request_header parameter
4
+
1
5
  ### 3.0.3 (2019-10-09)
2
6
 
3
7
  * remove titles from graphs (previously set to '' which caused problems when deployed)
@@ -2,11 +2,11 @@
2
2
  module PrependedLinkedData::FindTerm
3
3
  # Override Qa::Authorities::LinkedData::FindTerm#find method
4
4
  # @return [Hash] single term results in requested format
5
- def find(id, language: nil, replacements: {}, subauth: nil, format: nil, jsonld: false, performance_data: false) # rubocop:disable Metrics/ParameterLists
5
+ def find(id, request_header: {}, language: nil, replacements: {}, subauth: nil, format: nil, performance_data: false) # rubocop:disable Metrics/ParameterLists
6
6
  start_time_s = Time.now.to_f
7
7
 
8
- saved_performance_data = performance_data
9
- performance_data = true
8
+ saved_performance_data = performance_data || request_header[:performance_data]
9
+ request_header[:performance_data] = true
10
10
  ph_record = QaServer::PerformanceHistory.create_record(authority: authority_name, action: 'fetch')
11
11
  @phid = ph_record.id
12
12
  begin
@@ -16,7 +16,7 @@ module PrependedLinkedData::FindTerm
16
16
  ph_record.destroy
17
17
  raise e
18
18
  end
19
- saved_performance_data || !full_results.key?(:results) ? full_results : full_results[:results]
19
+ saved_performance_data || !full_results.is_a?(Hash) ? full_results : full_results[:results]
20
20
  end
21
21
 
22
22
  private
@@ -2,11 +2,11 @@
2
2
  module PrependedLinkedData::SearchQuery
3
3
  # Override Qa::Authorities::LinkedData::SearchQuery#search method
4
4
  # @return [String] json results for search query
5
- def search(query, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) # rubocop:disable Metrics/ParameterLists
5
+ def search(query, request_header: {}, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) # rubocop:disable Metrics/ParameterLists
6
6
  start_time_s = Time.now.to_f
7
7
 
8
- saved_performance_data = performance_data
9
- performance_data = true
8
+ saved_performance_data = performance_data || request_header[:performance_data]
9
+ request_header[:performance_data] = true
10
10
  ph_record = QaServer::PerformanceHistory.create_record(authority: authority_name, action: 'search')
11
11
  @phid = ph_record.id
12
12
  begin
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module QaServer
3
- VERSION = '3.0.3'
3
+ VERSION = '4.0.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qa_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - E. Lynette Rayle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-10 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails