diff options
| author | Zog | 2018-04-25 11:15:31 +0200 | 
|---|---|---|
| committer | Johan Van Ryseghem | 2018-04-25 15:46:33 +0200 | 
| commit | 0f0be7d01a87c64f30539205379e4d7588f6d73e (patch) | |
| tree | 11e5af8797ee3cbc3807b5f62877323333a5f029 /app/models/custom_field.rb | |
| parent | a0567f40c0ad57abcf630d97816e38f73750138e (diff) | |
| download | chouette-core-0f0be7d01a87c64f30539205379e4d7588f6d73e.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 | 
