active-fedora 10.0.0.beta3 → 10.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_fedora/file.rb +6 -6
- data/lib/active_fedora/indexing_service.rb +0 -1
- data/lib/active_fedora/version.rb +1 -1
- data/lib/generators/active_fedora/config/solr/templates/solr/config/solrconfig.xml +0 -1
- data/solr/config/solrconfig.xml +0 -1
- data/spec/unit/file_spec.rb +15 -0
- data/spec/unit/indexing_spec.rb +0 -4
- data/spec/unit/query_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e36715dc8027b42414b4eb6ee41de795e32dd2a1
|
4
|
+
data.tar.gz: 9dcf77ceae0e395977a06a31164787df2ef23f81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01bd95f9fae07b1d327f7c5eae435357b29c5edac4062707087e56f070a8701bc77a5d5a4209b63434c016f457ce1202bbccb69158b4cb73bf74c8cde4e52228
|
7
|
+
data.tar.gz: 56cfeed533c1c9cfc0360e9b386d625392f9f60d77f531f30f909725b94d29d3aab782e6b1115e15d1f781c965ae5b603d508fc825d88f5d7d006ea23c02f250
|
data/lib/active_fedora/file.rb
CHANGED
@@ -48,12 +48,6 @@ module ActiveFedora
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
def save
|
52
|
-
super.tap do
|
53
|
-
metadata.save if metadata.changed?
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
51
|
def described_by
|
58
52
|
raise "#{self} isn't persisted yet" if new_record?
|
59
53
|
links['describedby'].first
|
@@ -176,6 +170,12 @@ module ActiveFedora
|
|
176
170
|
|
177
171
|
private
|
178
172
|
|
173
|
+
def create_or_update(*options)
|
174
|
+
super.tap do
|
175
|
+
metadata.save if metadata.changed?
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
179
|
# Rack::Test::UploadedFile is often set via content=, however it's not an IO, though it wraps an io object.
|
180
180
|
def behaves_like_io?(obj)
|
181
181
|
[IO, Tempfile, StringIO].any? { |klass| obj.is_a? klass } || (defined?(Rack) && obj.is_a?(Rack::Test::UploadedFile))
|
@@ -38,7 +38,6 @@ module ActiveFedora
|
|
38
38
|
solr_doc = {}
|
39
39
|
Solrizer.set_field(solr_doc, 'system_create', c_time, :stored_sortable)
|
40
40
|
Solrizer.set_field(solr_doc, 'system_modified', m_time, :stored_sortable)
|
41
|
-
Solrizer.set_field(solr_doc, 'active_fedora_model', object.class.inspect, :stored_sortable)
|
42
41
|
solr_doc[QueryResultBuilder::HAS_MODEL_SOLR_FIELD] = object.has_model
|
43
42
|
solr_doc[ActiveFedora.id_field.to_sym] = object.id
|
44
43
|
solr_doc[self.class.profile_solr_name] = profile_service.new(object).export
|
data/solr/config/solrconfig.xml
CHANGED
data/spec/unit/file_spec.rb
CHANGED
@@ -7,6 +7,21 @@ describe ActiveFedora::File do
|
|
7
7
|
|
8
8
|
it { is_expected.not_to be_metadata }
|
9
9
|
|
10
|
+
describe "#save!" do
|
11
|
+
context "when updating metadata" do
|
12
|
+
before do
|
13
|
+
file.content = 'foo'
|
14
|
+
file.save!
|
15
|
+
file.mime_type = 'application/pdf'
|
16
|
+
end
|
17
|
+
|
18
|
+
it "Updates metadata" do
|
19
|
+
expect(file.metadata).to receive(:save)
|
20
|
+
file.save!
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
10
25
|
describe "#behaves_like_io?" do
|
11
26
|
subject { file.send(:behaves_like_io?, object) }
|
12
27
|
|
data/spec/unit/indexing_spec.rb
CHANGED
@@ -71,10 +71,6 @@ describe ActiveFedora::Indexing do
|
|
71
71
|
expect(solr_doc[:id]).to eql("changeme:123")
|
72
72
|
end
|
73
73
|
|
74
|
-
it "adds self.class as the :active_fedora_model" do
|
75
|
-
expect(subject[ActiveFedora.index_field_mapper.solr_name("active_fedora_model", :stored_sortable)]).to eql "SpecNode"
|
76
|
-
end
|
77
|
-
|
78
74
|
context "with attached files" do
|
79
75
|
let(:mock1) { double("ds1") }
|
80
76
|
let(:mock2) { double("ds2") }
|
data/spec/unit/query_spec.rb
CHANGED
@@ -95,11 +95,11 @@ describe ActiveFedora::Base do
|
|
95
95
|
end
|
96
96
|
|
97
97
|
it "queries for empty strings" do
|
98
|
-
expect(SpecModel::Basic.where(
|
98
|
+
expect(SpecModel::Basic.where(has_model_ssim: '').count).to eq 0
|
99
99
|
end
|
100
100
|
|
101
101
|
it 'queries for empty arrays' do
|
102
|
-
expect(SpecModel::Basic.where(
|
102
|
+
expect(SpecModel::Basic.where(has_model_ssim: []).count).to eq 0
|
103
103
|
end
|
104
104
|
|
105
105
|
it "adds options" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.0.0.
|
4
|
+
version: 10.0.0.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-06-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -777,7 +777,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
777
777
|
version: 1.3.1
|
778
778
|
requirements: []
|
779
779
|
rubyforge_project:
|
780
|
-
rubygems_version: 2.
|
780
|
+
rubygems_version: 2.5.1
|
781
781
|
signing_key:
|
782
782
|
specification_version: 4
|
783
783
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|