blacklight 6.7.0 → 6.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/models/concerns/blacklight/document.rb +6 -1
- data/spec/models/blacklight/document_spec.rb +15 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7017f77770714ea07e09285f82825f8e96bb0df4
|
4
|
+
data.tar.gz: 11bbf9de777e8474b4e68a7b76cdd32ef1fe1f8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 804aaba34b735e0c33aac3e5972d0ec9d2c1768ce8e830e08ecf55231955c8c45e2e8de37c12c529e8595b868fb87bd7756aabb9ffa900bc8b1d4114c24612a7
|
7
|
+
data.tar.gz: 3ce45061d77dd9daf9ca1fe673eee5da7b423aa6b79fd25987251c2ae9c6b0cb3dd857f7f3d7fae0f678fabc48e55cb296007e25d81b83a82d2f7b6b248814f0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.7.
|
1
|
+
6.7.1
|
@@ -44,7 +44,12 @@ module Blacklight::Document
|
|
44
44
|
delegate :[], :key?, :keys, :to_h, to: :_source
|
45
45
|
|
46
46
|
def initialize(source_doc={}, response=nil)
|
47
|
-
@_source =
|
47
|
+
@_source = if source_doc.respond_to?(:to_hash)
|
48
|
+
ActiveSupport::HashWithIndifferentAccess.new(source_doc)
|
49
|
+
else
|
50
|
+
Deprecation.warn(Blacklight::Document, "Blacklight::Document#initialize expects a hash-like object, received #{source_doc.class}.")
|
51
|
+
ActiveSupport::HashWithIndifferentAccess.new(source_doc.to_h)
|
52
|
+
end
|
48
53
|
@response = response
|
49
54
|
apply_extensions
|
50
55
|
end
|
@@ -2,10 +2,23 @@
|
|
2
2
|
|
3
3
|
describe Blacklight::Document do
|
4
4
|
let(:data) { {} }
|
5
|
-
|
5
|
+
let(:test_class) do
|
6
6
|
Class.new do
|
7
7
|
include Blacklight::Document
|
8
|
-
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
subject { test_class.new(data) }
|
12
|
+
|
13
|
+
describe '.new' do
|
14
|
+
it 'accepts a hash' do
|
15
|
+
expect(test_class.new(id: 1)[:id]).to eq 1
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'accepts a SolrDocument' do
|
19
|
+
expect(Deprecation).to receive(:warn)
|
20
|
+
expect(test_class.new(test_class.new(id: 1))[:id]).to eq 1
|
21
|
+
end
|
9
22
|
end
|
10
23
|
|
11
24
|
describe "#has?" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.7.
|
4
|
+
version: 6.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: exe
|
19
19
|
cert_chain: []
|
20
|
-
date: 2016-09-
|
20
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|