active-fedora 6.6.0.rc2 → 6.6.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -3
- data/lib/active_fedora/base.rb +1 -1
- data/lib/active_fedora/relation.rb +7 -1
- data/lib/active_fedora/version.rb +1 -1
- data/spec/integration/delete_all_spec.rb +16 -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: b35e64f462528b26276ef2a730c8f03b80a24658
|
4
|
+
data.tar.gz: 616b6f3a7ac2297f197bf6792bb76d0055aaa377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de1f89551de40f7d43ad138efc174a5428f03561f2ddcf1b475dfdae96abf4e55f2bb6e510f091c7567cb33162d02c5a674ad2540b4bf97a693077a4fbfde68e
|
7
|
+
data.tar.gz: cf48aec03e4bb5502823a1537128aa827c503bc06f4a2d945275d099d6ff40dac82c0257abe1a16a191d2b4876054d1269e61018e6cdd4f9624843bdd4e8232d
|
data/History.txt
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
v6.6.0 (
|
2
|
-
|
1
|
+
v6.6.0 (rc3)
|
2
|
+
Explicitly set cast to false on reload to avoid deprecation warnings [Justin Coyne]
|
3
|
+
Cast relationship results if class is ActiveFedora::Base [Justin
|
3
4
|
Coyne]
|
5
|
+
* Need to put changes for rc1 here*
|
4
6
|
|
5
7
|
v6.5.1 (2013-09-10)
|
6
8
|
|
7
|
-
|
8
9
|
ActiveFedora::Predicates.set_predicates allows you to set predicates
|
9
10
|
without wiping out existing configs [Matt Zumwalt]
|
10
11
|
|
data/lib/active_fedora/base.rb
CHANGED
@@ -97,7 +97,7 @@ module ActiveFedora
|
|
97
97
|
# Reloads the object from Fedora.
|
98
98
|
def reload
|
99
99
|
clear_association_cache
|
100
|
-
init_with(self.class.find(self.pid).inner_object)
|
100
|
+
init_with(self.class.find(self.pid, cast: false).inner_object)
|
101
101
|
end
|
102
102
|
|
103
103
|
# Initialize an empty model object and set the +inner_obj+
|
@@ -230,7 +230,13 @@ module ActiveFedora
|
|
230
230
|
if conditions
|
231
231
|
where(conditions).destroy_all
|
232
232
|
else
|
233
|
-
to_a.each {|object|
|
233
|
+
to_a.each {|object|
|
234
|
+
begin
|
235
|
+
object.destroy
|
236
|
+
rescue ActiveFedora::ObjectNotFoundError
|
237
|
+
logger.error "When trying to destroy #{object.pid}, encountered an ObjectNotFoundError. Solr may be out of sync with Fedora"
|
238
|
+
end
|
239
|
+
}.tap { reset }.size
|
234
240
|
end
|
235
241
|
end
|
236
242
|
|
@@ -20,9 +20,10 @@ describe ActiveFedora::Base do
|
|
20
20
|
Object.send(:remove_const, :SpecModel)
|
21
21
|
end
|
22
22
|
|
23
|
+
let!(:model1) { SpecModel::Basic.create! }
|
24
|
+
let!(:model2) { SpecModel::Basic.create! }
|
25
|
+
|
23
26
|
before do
|
24
|
-
SpecModel::Basic.create!
|
25
|
-
SpecModel::Basic.create!
|
26
27
|
SpecModel::Basic.callback_counter = 0
|
27
28
|
end
|
28
29
|
|
@@ -34,6 +35,19 @@ describe ActiveFedora::Base do
|
|
34
35
|
SpecModel::Basic.callback_counter.should == 2
|
35
36
|
end
|
36
37
|
|
38
|
+
describe "when a model is missing" do
|
39
|
+
let(:model3) { SpecModel::Basic.create! }
|
40
|
+
after { model3.delete }
|
41
|
+
it "should be able to skip a missing model" do
|
42
|
+
model1.should_receive(:destroy).and_call_original
|
43
|
+
model2.should_receive(:destroy).and_call_original
|
44
|
+
model3.should_receive(:destroy).and_raise(ActiveFedora::ObjectNotFoundError)
|
45
|
+
ActiveFedora::Relation.any_instance.should_receive(:to_a).and_return([model1, model3, model2])
|
46
|
+
ActiveFedora::Relation.logger.should_receive(:error).with("When trying to destroy #{model3.pid}, encountered an ObjectNotFoundError. Solr may be out of sync with Fedora")
|
47
|
+
SpecModel::Basic.destroy_all
|
48
|
+
SpecModel::Basic.count.should == 1
|
49
|
+
end
|
50
|
+
end
|
37
51
|
end
|
38
52
|
|
39
53
|
describe ".delete_all" 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: 6.6.0.
|
4
|
+
version: 6.6.0.rc3
|
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: 2013-10-
|
13
|
+
date: 2013-10-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|