-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
I kept hitting this undefined constant error, see deivid-rodriguez/byebug#564 to use debug insert `binding.break`
3e81017
to
9dc6bca
Compare
Uses a service which sets the first member fileset as the new thumbnail
7bd59a1
to
fee9007
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Thanks for catching those @eliotjordan -- take another look? |
binding.break
refs #6081