mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Rules: Fix no action conditions (#447)
* Fix Rules page when no action on rule * Reject new rules without actions * Rule with no action translation * Easy one to keep translations going * Fix tests * Learn something new every day --------- Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
@@ -101,7 +101,7 @@ class Rule < ApplicationRecord
|
||||
end
|
||||
|
||||
def min_actions
|
||||
return if new_record? && actions.empty?
|
||||
return if new_record? && !actions.empty?
|
||||
|
||||
if actions.reject(&:marked_for_destruction?).empty?
|
||||
errors.add(:base, "must have at least one action")
|
||||
|
||||
Reference in New Issue
Block a user