mod/core/set/all/trash.rb in card-1.91 vs mod/core/set/all/trash.rb in card-1.92
- old
+ new
@@ -1,13 +1,14 @@
Self::Admin.add_to_basket(
:tasks,
name: :empty_trash,
+ irreversible: true,
execute_policy: -> { Card.empty_trash },
stats: {
title: "trashed cards",
count: -> { Card.where(trash: true) },
- link_text: "delete all",
+ link_text: "empty trash",
task: "empty_trash"
}
)
module ClassMethods
@@ -82,11 +83,11 @@
undeletable_all_rules_tags =
%w[default style layout create read update delete]
# FIXME: HACK! should be configured in the rule
- if junction? && (l = left) && l.codename == "all" &&
- undeletable_all_rules_tags.member?(right.codename)
+ if junction? && left&.codename == :all &&
+ undeletable_all_rules_tags.member?(right.codename.to_s)
errors.add :delete, "#{name} is an indestructible rule"
end
if account && has_edits?
errors.add :delete, "Edits have been made with #{name}'s user account.\n" \