Class: Cats::Core::StackingRule

Inherits:
ApplicationRecord show all
Defined in:
app/models/cats/core/stacking_rule.rb

Instance Method Summary collapse

Instance Method Details

#validate_only_a_record_existObject



8
9
10
11
12
13
# File 'app/models/cats/core/stacking_rule.rb', line 8

def validate_only_a_record_exist
  return unless StackingRule.count > 1

  errors.add(:base,
             "There is already a stacking rule entry. A new rule can not be added")
end