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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e34459d1ad716b37cd7174ec1312abe1ca33cd87
4
- data.tar.gz: 85f71b569ee2010337e1733092c982b4b4021809
3
+ metadata.gz: b35e64f462528b26276ef2a730c8f03b80a24658
4
+ data.tar.gz: 616b6f3a7ac2297f197bf6792bb76d0055aaa377
5
5
  SHA512:
6
- metadata.gz: 535fc44e507b82bfcd884033bf95e40df1207b484540eb952c7f1a7163545819a4f6afcfc47636ca6f98865c59ee6441517031d22f25d7fb552a0094af7f8643
7
- data.tar.gz: d34bcfcd2d6326a34726337ab744ee284c4ae8dbce9750a9cf1be370ca16a0e7793dc80aef87aecd687ce1fba9e326ef3a1ddb09197a7766d55cd434f0674a1b
6
+ metadata.gz: de1f89551de40f7d43ad138efc174a5428f03561f2ddcf1b475dfdae96abf4e55f2bb6e510f091c7567cb33162d02c5a674ad2540b4bf97a693077a4fbfde68e
7
+ data.tar.gz: cf48aec03e4bb5502823a1537128aa827c503bc06f4a2d945275d099d6ff40dac82c0257abe1a16a191d2b4876054d1269e61018e6cdd4f9624843bdd4e8232d
@@ -1,10 +1,11 @@
1
- v6.6.0 (rc2)
2
- 2013-10-02: Cast relationship results if class is ActiveFedora::Base [Justin
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
 
@@ -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| object.destroy }.tap { reset }.size
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
 
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "6.6.0.rc2"
2
+ VERSION = "6.6.0.rc3"
3
3
  end
@@ -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.rc2
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-02 00:00:00.000000000 Z
13
+ date: 2013-10-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr