circleci
3 of 3 new or added lines in 3 files covered. (100.0%)
455 existing lines in 52 files now uncovered.3018 of 3233 relevant lines covered (93.35%)
51.16 hits per line
1 |
class PrimaryFileTitleActor < Hyrax::Actors::AbstractActor |
4✔ |
2 |
def update(env) |
4✔ |
UNCOV
3
|
update_primary_file_title(env.curation_concern, env.attributes['title'])
|
10✔ |
UNCOV
4
|
next_actor.update(env) |
10✔ |
5 |
end
|
|
6 |
|
|
7 |
# If you change the title of the ETD, the title of
|
|
8 |
# the primary PDF should change too.
|
|
9 |
def update_primary_file_title(etd, new_title) |
4✔ |
UNCOV
10
|
return unless new_title |
10✔ |
11 |
|
|
UNCOV
12
|
old_title = etd.title.to_a |
6✔ |
UNCOV
13
|
return if new_title == old_title |
6✔ |
14 |
|
|
UNCOV
15
|
file_set = etd.primary_file_fs.first |
3✔ |
UNCOV
16
|
return unless file_set |
3✔ |
17 |
|
|
UNCOV
18
|
file_set.title = new_title |
1✔ |
UNCOV
19
|
file_set.save |
1✔ |
20 |
end
|
|
21 |
end
|