curation_concerns 1.0.0.beta10 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/actors/curation_concerns/actors/actor_stack.rb +9 -0
- data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +4 -3
- data/curation_concerns.gemspec +1 -1
- data/lib/curation_concerns/version.rb +1 -1
- data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +14 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb8f7385740c5fbbc0735eba71e83175368a313
|
4
|
+
data.tar.gz: d0715c82e683b32154dba32111d02b31e9101af6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25e1d462f3f5db545779bd0a03a458ae4ad1f7b961163bb50d55a8a7537e70cbc343db5b9a26ea4c17dcaa8937266e41fc094b48b6fe7f7885b406db540e1e9b
|
7
|
+
data.tar.gz: 82f824c0adddcb8f722eb41a85876fea18c5e0b3045c1282ebd73eb176776303b1f7ce37fa59c1d4727ab7d9e152db3beb8df5d889503aa89e139a2c5bcc5856
|
@@ -24,6 +24,15 @@ module CurationConcerns
|
|
24
24
|
def update(attributes)
|
25
25
|
actor.update(attributes.with_indifferent_access)
|
26
26
|
end
|
27
|
+
|
28
|
+
def destroy
|
29
|
+
curation_concern.in_collection_ids.each do |id|
|
30
|
+
destination_collection = ::Collection.find(id)
|
31
|
+
destination_collection.members.delete(curation_concern)
|
32
|
+
destination_collection.update_index
|
33
|
+
end
|
34
|
+
curation_concern.destroy
|
35
|
+
end
|
27
36
|
end
|
28
37
|
end
|
29
38
|
end
|
@@ -95,9 +95,10 @@ module CurationConcerns::CurationConcernController
|
|
95
95
|
|
96
96
|
def destroy
|
97
97
|
title = curation_concern.to_s
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
if actor.destroy
|
99
|
+
CurationConcerns.config.callback.run(:after_destroy, curation_concern.id, current_user)
|
100
|
+
after_destroy_response(title)
|
101
|
+
end
|
101
102
|
end
|
102
103
|
|
103
104
|
def file_manager
|
data/curation_concerns.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency 'hydra-head', '>= 10.0.0
|
21
|
+
spec.add_dependency 'hydra-head', '>= 10.0.0', '< 11'
|
22
22
|
spec.add_dependency 'blacklight', '~> 6.1'
|
23
23
|
spec.add_dependency "breadcrumbs_on_rails", "~> 2.3"
|
24
24
|
spec.add_dependency "jquery-ui-rails"
|
@@ -235,6 +235,7 @@ describe CurationConcerns::GenericWorksController do
|
|
235
235
|
|
236
236
|
describe '#destroy' do
|
237
237
|
let(:work_to_be_deleted) { create(:private_generic_work, user: user) }
|
238
|
+
let(:parent_collection) { create(:collection) }
|
238
239
|
|
239
240
|
it 'deletes the work' do
|
240
241
|
delete :destroy, id: work_to_be_deleted
|
@@ -242,6 +243,19 @@ describe CurationConcerns::GenericWorksController do
|
|
242
243
|
expect(GenericWork).not_to exist(work_to_be_deleted.id)
|
243
244
|
end
|
244
245
|
|
246
|
+
context "when work is a member of a collection" do
|
247
|
+
before do
|
248
|
+
parent_collection.members = [work_to_be_deleted]
|
249
|
+
parent_collection.save!
|
250
|
+
end
|
251
|
+
it 'deletes the work and updates the parent collection' do
|
252
|
+
delete :destroy, id: work_to_be_deleted
|
253
|
+
expect(GenericWork).not_to exist(work_to_be_deleted.id)
|
254
|
+
expect(response).to redirect_to main_app.search_catalog_path
|
255
|
+
expect(parent_collection.reload.members).to eq []
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
245
259
|
it "invokes the after_destroy callback" do
|
246
260
|
expect(CurationConcerns.config.callback).to receive(:run)
|
247
261
|
.with(:after_destroy, work_to_be_deleted.id, user)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curation_concerns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.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: 2016-06-
|
13
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hydra-head
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 10.0.0
|
21
|
+
version: 10.0.0
|
22
22
|
- - "<"
|
23
23
|
- !ruby/object:Gem::Version
|
24
24
|
version: '11'
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: 10.0.0
|
31
|
+
version: 10.0.0
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '11'
|
@@ -1241,9 +1241,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1241
1241
|
version: '0'
|
1242
1242
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1243
1243
|
requirements:
|
1244
|
-
- - "
|
1244
|
+
- - ">="
|
1245
1245
|
- !ruby/object:Gem::Version
|
1246
|
-
version:
|
1246
|
+
version: '0'
|
1247
1247
|
requirements: []
|
1248
1248
|
rubyforge_project:
|
1249
1249
|
rubygems_version: 2.5.1
|