diff options
| author | Zog | 2018-04-04 09:15:59 +0200 |
|---|---|---|
| committer | Johan Van Ryseghem | 2018-04-04 11:08:20 +0200 |
| commit | a77307ca49c57dc18823f6aece2424ccb3c5a7c2 (patch) | |
| tree | a791261bf42ff23d92aaaa2a2f82d9c979b98e07 /app/models | |
| parent | f946eb8d72a5601020c420b33225c31b12277be4 (diff) | |
| download | chouette-core-a77307ca49c57dc18823f6aece2424ccb3c5a7c2.tar.bz2 | |
Fix specs
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/concerns/custom_fields_support.rb | 2 | ||||
| -rw-r--r-- | app/models/custom_field.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/models/concerns/custom_fields_support.rb b/app/models/concerns/custom_fields_support.rb index 4faff694e..7d2c22537 100644 --- a/app/models/concerns/custom_fields_support.rb +++ b/app/models/concerns/custom_fields_support.rb @@ -16,7 +16,7 @@ module CustomFieldsSupport def custom_field_values= vals out = {} vals.each do |k, val| - out[k] = custom_fields[k].preprocess_value_for_assignment(val) + out[k] = custom_fields[k]&.preprocess_value_for_assignment(val) end self.write_attribute :custom_field_values, out end diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 62c43f1b4..98cb38614 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -38,7 +38,7 @@ class CustomField < ActiveRecord::Base @valid = false end attr_accessor :owner - + delegate :code, :name, :field_type, to: :@custom_field def options @@ -73,7 +73,8 @@ class CustomField < ActiveRecord::Base def initialize_custom_field end - def preprocess_value_for_assignment + def preprocess_value_for_assignment val + val end def render_partial |
