aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/custom_field.rb
diff options
context:
space:
mode:
authorZog2018-04-24 09:04:13 +0200
committerJohan Van Ryseghem2018-04-25 15:46:33 +0200
commitc3e6817f2cb2e35c90434574efac256d62636830 (patch)
tree9f73835363786994539c637123366d60013d58d7 /app/models/custom_field.rb
parentf838c165685972992d1ee7f597c9d94662099d89 (diff)
downloadchouette-core-c3e6817f2cb2e35c90434574efac256d62636830.tar.bz2
Refs #6669; Fix CustomField initialization
Use the current referential to infer the workgroup
Diffstat (limited to 'app/models/custom_field.rb')
-rw-r--r--app/models/custom_field.rb2
1 files changed, 1 insertions, 1 deletions
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