active-fedora 9.0.0.beta6 → 9.0.0.beta7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/active-fedora.gemspec +1 -1
- data/lib/active_fedora/associations/collection_association.rb +3 -2
- data/lib/active_fedora/attributes.rb +2 -2
- data/lib/active_fedora/version.rb +1 -1
- data/spec/integration/collection_association_spec.rb +9 -2
- data/spec/unit/attributes_spec.rb +18 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0efb77ba5a2ca5e2a3a904bf1f6181eb8ec1b7b6
|
4
|
+
data.tar.gz: f3996a300d97a4237839bb8875754a5c8eb8a54d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb3b8dc10a355f976a397a67ae4d638a4de029bab93dbe63993e317890e1a3b0c9e75e7403c29b2accb349a1ee1e14984321aa4877aed56bb0a91dd2d8152922
|
7
|
+
data.tar.gz: 8305e854f8477f0796b094cbf7e048874971687801d7d19450c05b22a82b9f8e016c316f0c4b13c24144b3956026898a3ee6a2d8d5aed7450802ef0e76e9b60e
|
data/active-fedora.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency "rdf-rdfxml", '~> 1.1.0'
|
23
23
|
s.add_dependency "linkeddata"
|
24
24
|
s.add_dependency "deprecation"
|
25
|
-
s.add_dependency "ldp", '~> 0.
|
25
|
+
s.add_dependency "ldp", '~> 0.2.0'
|
26
26
|
s.add_dependency "rdf-ldp"
|
27
27
|
|
28
28
|
s.add_development_dependency "rdoc"
|
@@ -292,8 +292,9 @@ module ActiveFedora
|
|
292
292
|
# @param opts [Hash] Options that will be passed through to ActiveFedora::SolrService.query.
|
293
293
|
def load_from_solr(opts = Hash.new)
|
294
294
|
return [] if @finder_query.empty?
|
295
|
-
|
296
|
-
|
295
|
+
rows = opts.delete(:rows) { count }
|
296
|
+
return [] if rows == 0
|
297
|
+
SolrService.query(@finder_query, {rows: rows}.merge(opts))
|
297
298
|
end
|
298
299
|
|
299
300
|
def add_to_target(record, skip_callbacks = false)
|
@@ -40,8 +40,8 @@ module ActiveFedora
|
|
40
40
|
# This is for id attributes stored in the rdf graph.
|
41
41
|
assoc.reader
|
42
42
|
elsif self.class.properties.key?(key.to_s)
|
43
|
-
#
|
44
|
-
|
43
|
+
# Use the generated method so that single value assetions are single
|
44
|
+
self.send(key)
|
45
45
|
else
|
46
46
|
# The attribute is a delegate to a datastream
|
47
47
|
array_reader(key)
|
@@ -9,22 +9,29 @@ describe ActiveFedora::Base do
|
|
9
9
|
belongs_to :library, predicate: ActiveFedora::RDF::RelsExt.hasMember
|
10
10
|
end
|
11
11
|
end
|
12
|
+
|
12
13
|
let(:library) { Library.create! }
|
13
14
|
let!(:book1) { Book.create!(library: library) }
|
14
15
|
let!(:book2) { Book.create!(library: library) }
|
16
|
+
|
15
17
|
after do
|
16
|
-
Book.delete_all
|
17
|
-
Library.delete_all
|
18
18
|
Object.send(:remove_const, :Library)
|
19
19
|
Object.send(:remove_const, :Book)
|
20
20
|
end
|
21
|
+
|
21
22
|
describe "load_from_solr" do
|
22
23
|
it "should set rows to count, if not specified" do
|
23
24
|
expect(library.books(response_format: :solr).size).to eq 2
|
24
25
|
end
|
26
|
+
|
25
27
|
it "should limit rows returned if option passed" do
|
26
28
|
expect(library.books(response_format: :solr, rows: 1).size).to eq 1
|
27
29
|
end
|
30
|
+
|
31
|
+
it "should not query solr if rows is 0" do
|
32
|
+
expect(ActiveFedora::SolrService).not_to receive(:query)
|
33
|
+
expect(library.books(response_format: :solr, rows: 0)).to eq []
|
34
|
+
end
|
28
35
|
end
|
29
36
|
|
30
37
|
describe "#delete_all" do
|
@@ -405,8 +405,24 @@ describe ActiveFedora::Base do
|
|
405
405
|
let(:obj) { BarHistory4.new(title: ['test1']) }
|
406
406
|
subject { obj }
|
407
407
|
|
408
|
-
|
409
|
-
|
408
|
+
describe "accessing attributes" do
|
409
|
+
context "using generated methods" do
|
410
|
+
it "should return values" do
|
411
|
+
expect(subject.title).to eq ['test1']
|
412
|
+
end
|
413
|
+
end
|
414
|
+
|
415
|
+
context "using hash accessors" do
|
416
|
+
context "on single value fields" do
|
417
|
+
it "should have a default value" do
|
418
|
+
expect(subject[:abstract]).to be_nil
|
419
|
+
end
|
420
|
+
|
421
|
+
it "should return values" do
|
422
|
+
expect(subject[:title]).to eq ['test1']
|
423
|
+
end
|
424
|
+
end
|
425
|
+
end
|
410
426
|
end
|
411
427
|
|
412
428
|
context "indexing" 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: 9.0.0.
|
4
|
+
version: 9.0.0.beta7
|
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: 2014-12-
|
13
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -130,14 +130,14 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - "~>"
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
133
|
+
version: 0.2.0
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
138
|
- - "~>"
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: 0.
|
140
|
+
version: 0.2.0
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: rdf-ldp
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|