diff options
| author | Robert | 2018-01-09 17:46:20 +0100 |
|---|---|---|
| committer | Alban Peignier | 2018-01-10 17:47:10 +0100 |
| commit | fd553851e9e6c59b998eef8577836a954c4d43f3 (patch) | |
| tree | 9f5c170444ec1612a1494984356f838d393de0e1 /app/models/custom_field.rb | |
| parent | 2be1e1c2bc313f586c4e0385d90a8cfbcd9ab609 (diff) | |
| download | chouette-core-fd553851e9e6c59b998eef8577836a954c4d43f3.tar.bz2 | |
Refs: #5505@0.5h, added tests and validations
Diffstat (limited to 'app/models/custom_field.rb')
| -rw-r--r-- | app/models/custom_field.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 74e825d77..e8e76c6b5 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -1,2 +1,7 @@ class CustomField < ActiveRecord::Base + + extend Enumerize + enumerize :field_type, in: %i{list} + + validates :name, uniqueness: {scope: :resource_type} end |
