From d3ab2606ffd3dcb94a27d7b4e7c899f1238d3a53 Mon Sep 17 00:00:00 2001 From: Zog Date: Tue, 27 Mar 2018 15:05:37 +0200 Subject: Fix CustomFields with nil options --- app/models/custom_field.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 4a840744e..402df7fa9 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -38,7 +38,11 @@ class CustomField < ActiveRecord::Base @valid = false end - delegate :code, :name, :field_type, :options, to: :@custom_field + delegate :code, :name, :field_type, to: :@custom_field + + def options + @custom_field.options || {} + end def validate @valid = true -- cgit v1.2.3