From c3e6817f2cb2e35c90434574efac256d62636830 Mon Sep 17 00:00:00 2001 From: Zog Date: Tue, 24 Apr 2018 09:04:13 +0200 Subject: Refs #6669; Fix CustomField initialization Use the current referential to infer the workgroup --- app/models/custom_field.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/custom_field.rb') diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 88783b5b4..b5c08465d 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -8,7 +8,7 @@ class CustomField < ApplicationModel validates :code, uniqueness: {scope: [:resource_type, :workgroup_id], case_sensitive: false}, presence: true class Collection < HashWithIndifferentAccess - def initialize object, workgroup=:all + def initialize object, workgroup=nil vals = object.class.custom_fields(workgroup).map do |v| [v.code, CustomField::Instance.new(object, v, object.custom_field_value(v.code))] end -- cgit v1.2.3