aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/custom_field.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/custom_field.rb')
-rw-r--r--app/models/custom_field.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 60aa25e85..8347d84f9 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -12,7 +12,7 @@ class CustomField < ActiveRecord::Base
scope :for_workgroup, ->(workgroup){ where workgroup_id: workgroup.id }
class Collection < HashWithIndifferentAccess
- def initialize object, workgroup=nil
+ def initialize object, workgroup=:all
vals = object.class.custom_fields(workgroup).map do |v|
[v.code, CustomField::Instance.new(object, v, object.custom_field_value(v.code))]
end
@@ -176,8 +176,8 @@ class CustomField < ActiveRecord::Base
class Input < Base::Input
def form_input_options
collection = options["list_values"]
- collection = collection.map(&:reverse) if collection.is_a?(Hash)
collection = collection.each_with_index.to_a if collection.is_a?(Array)
+ collection = collection.map(&:reverse) if collection.is_a?(Hash)
super.update({
selected: value,
collection: collection