Project

General

Profile

Revision 00bd7de4

Added by Michael Moll about 5 years ago

More Rails 5.1 changes

  • Refs #22045 - Remove condition to destroy_all
  • Refs #22045 - Replace 'xhr' in tests with keyword argument
  • Refs #22045 - Replace deprecated AM::Errors usage
  • Refs #22045 - replace deprecated ActiveRecord_Relation access

View differences:

app/models/concerns/foreman_docker/parameter_validators.rb
16 16
          errors = duplicate_key?(keys, param)
17 17
        end
18 18

  
19
        self.errors[param_symbol] = _('Please ensure the following parameters are unique') if errors
19
        self.errors.add(param_symbol, _('Please ensure the following parameters are unique')) if errors
20 20
      end
21 21
    end
22 22

  
23 23
    def duplicate_key?(keys, param)
24 24
      if keys.include?(param.key)
25
        param.errors[:key] = _('has already been taken')
25
        param.errors.add(:key, _('has already been taken'))
26 26
        return true
27 27
      else
28 28
        keys << param.key

Also available in: Unified diff