Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rake task to clear bad thumbnails in an ephemera box #6098

Merged
merged 3 commits into from
Nov 29, 2023

Conversation

hackartisan
Copy link
Member

@hackartisan hackartisan commented Nov 27, 2023

refs #6081

@hackartisan hackartisan changed the title 6081 box 8 bad thumbnails Add rake task to clear bad thumbnails in an ephemera box Nov 27, 2023
I kept hitting this undefined constant error, see
deivid-rodriguez/byebug#564

to use debug insert `binding.break`
Uses a service which sets the first member fileset as the new thumbnail
Copy link
Member

@eliotjordan eliotjordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a few minor issues in the spec.


describe ".call" do
context "when given an ephemera box id" do
it "deletes FileSets which were set as thumbnails but have no parent" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Update this description as the service doesn't delete FileSets. Something that relays how the orphan file set is unset as the thumbnail?

end
end

context "when the no thumbnail resource doesn't exist and there are no members" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: small typo. "when the no thumbnail" -> "when the thumbnail"

attr_reader :box_id
def initialize(box_id:)
@box_id = box_id
raise InvalidResourceTypeError unless box.is_a? EphemeraBox
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 This is great. Exit early if not the correct resource type.

@hackartisan
Copy link
Member Author

Thanks for catching those @eliotjordan -- take another look?

@eliotjordan eliotjordan merged commit b4a7339 into main Nov 29, 2023
4 checks passed
@eliotjordan eliotjordan deleted the 6081-box-8-bad-thumbnails branch November 29, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants