diff options
| author | Zog | 2018-04-25 11:15:31 +0200 |
|---|---|---|
| committer | Zog | 2018-04-25 11:15:31 +0200 |
| commit | 61d3ca8b94a02ffe5220156cd77e04a34aea7e63 (patch) | |
| tree | bc7d5cbf3eabab53ae5215bf225804cadc1fbccb /app/models/custom_field.rb | |
| parent | ea7db3580265b86c1ccddd7ce5c90866ce208881 (diff) | |
| download | chouette-core-61d3ca8b94a02ffe5220156cd77e04a34aea7e63.tar.bz2 | |
Refs #6669; delay the custom fields initialization until the workgroup is loaded
Diffstat (limited to 'app/models/custom_field.rb')
| -rw-r--r-- | app/models/custom_field.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index b5c08465d..15aee9a41 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -147,6 +147,10 @@ class CustomField < ApplicationModel @raw_value&.to_i end + def preprocess_value_for_assignment val + val&.to_i + end + def validate @valid = true return if @raw_value.is_a?(Fixnum) || @raw_value.is_a?(Float) @@ -167,6 +171,10 @@ class CustomField < ApplicationModel end end + def preprocess_value_for_assignment val + val + end + def display_value return unless value k = options["list_values"].is_a?(Hash) ? value.to_s : value.to_i |
