diff options
| author | Zog | 2018-01-12 09:23:06 +0100 |
|---|---|---|
| committer | Zog | 2018-01-12 09:23:06 +0100 |
| commit | 41d2f53af34457c66cf3d504ac1bba610d11d596 (patch) | |
| tree | 5672bcfd20b8fa6bd1c5fb85b8632c0093f65e1b /app/models/custom_field.rb | |
| parent | 216821cbc5410a1377dd57b09ee2753aee13e37c (diff) | |
| download | chouette-core-41d2f53af34457c66cf3d504ac1bba610d11d596.tar.bz2 | |
Refs #5560; Add validation on CustomField5560-add-validation-on-customfields
Diffstat (limited to 'app/models/custom_field.rb')
| -rw-r--r-- | app/models/custom_field.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index e8e76c6b5..3f79ec62c 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -1,7 +1,8 @@ class CustomField < ActiveRecord::Base extend Enumerize - enumerize :field_type, in: %i{list} + enumerize :field_type, in: %i{list} validates :name, uniqueness: {scope: :resource_type} + validates :code, uniqueness: {scope: :resource_type, case_sensitive: false} end |
