active-fedora 7.0.0.rc3 → 7.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fa25da6ae7e46eb73b51e82f7497d6cf68a7e81
|
4
|
+
data.tar.gz: e8a47ec380de5f2b7cb8af447239aeab4774fdfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfbda832810e935c5d17b07baa68d14fb9c42727858d7c7b7fd5739698dc03a7f06251bcd1e52b55af0ead5614ca3d7867dd0893681c1ba3576071da4cf3c938
|
7
|
+
data.tar.gz: 05de3e9a1c2f039bec9699fdb827571ff3125a14df0cecca96789928b01e1a14a140a972d702da16aaf61ee6624bed7c930ac4cd3d6145ff7415e176ee542432
|
@@ -58,7 +58,7 @@ module ActiveFedora
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def delete_records(records, method)
|
61
|
-
records.each do |r|
|
61
|
+
records.each do |r|
|
62
62
|
@owner.remove_relationship(@reflection.options[:property], r)
|
63
63
|
|
64
64
|
if (@reflection.options[:inverse_of])
|
@@ -71,7 +71,7 @@ module ActiveFedora
|
|
71
71
|
r.save
|
72
72
|
end
|
73
73
|
end
|
74
|
-
@owner.save!
|
74
|
+
@owner.save! unless @owner.new_record?
|
75
75
|
end
|
76
76
|
|
77
77
|
end
|
@@ -63,4 +63,34 @@ describe ActiveFedora::Associations::HasAndBelongsToManyAssociation do
|
|
63
63
|
ac = ActiveFedora::Associations::HasAndBelongsToManyAssociation.new(subject, predicate)
|
64
64
|
ac.find_target
|
65
65
|
end
|
66
|
+
|
67
|
+
context "class with association" do
|
68
|
+
before do
|
69
|
+
class Collection < ActiveFedora::Base
|
70
|
+
has_and_belongs_to_many :members, :property => :has_collection_member, :class_name => "ActiveFedora::Base" , :after_remove => :remove_member
|
71
|
+
def remove_member (m)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class Thing < ActiveFedora::Base
|
76
|
+
has_many :collections, property: :has_collection_member, :class_name => "ActiveFedora::Base"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
after do
|
81
|
+
Collection.destroy_all
|
82
|
+
Thing.destroy_all
|
83
|
+
Object.send(:remove_const, :Collection)
|
84
|
+
Object.send(:remove_const, :Thing)
|
85
|
+
end
|
86
|
+
|
87
|
+
let(:thing) {Thing.create()}
|
88
|
+
let(:collection) {Collection.create().tap {|c| c.members << thing}}
|
89
|
+
|
90
|
+
it "should call destroy" do
|
91
|
+
expect(collection.destroy).to_not raise_error
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
66
96
|
end
|
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: 7.0.0
|
4
|
+
version: 7.0.0
|
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-03-
|
13
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -557,9 +557,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
557
557
|
version: 1.9.3
|
558
558
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
559
559
|
requirements:
|
560
|
-
- - "
|
560
|
+
- - ">="
|
561
561
|
- !ruby/object:Gem::Version
|
562
|
-
version:
|
562
|
+
version: '0'
|
563
563
|
requirements: []
|
564
564
|
rubyforge_project:
|
565
565
|
rubygems_version: 2.2.2
|