aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorZog2018-01-11 15:42:37 +0100
committerZog2018-01-11 15:42:37 +0100
commited0faeaaa7bddc135c7b55f6d12fd09a739afacc (patch)
tree488e5536757df1d7ac4bcf14436290c0c1d22244 /app/models
parentcb0564d4d7d35c8a43e166b68d8c7dc94341fc9d (diff)
downloadchouette-core-ed0faeaaa7bddc135c7b55f6d12fd09a739afacc.tar.bz2
Refs #5551 @0.5h; Implement the custom fields in the creation modal
And Refactor the component in the process
Diffstat (limited to 'app/models')
-rw-r--r--app/models/workgroup.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/workgroup.rb b/app/models/workgroup.rb
index 995917fac..511bbfeb0 100644
--- a/app/models/workgroup.rb
+++ b/app/models/workgroup.rb
@@ -11,4 +11,8 @@ class Workgroup < ActiveRecord::Base
validates_presence_of :stop_area_referential_id
has_many :custom_fields
+
+ def custom_fields_definitions
+ Hash[*custom_fields.map{|cf| [cf.code, cf]}.flatten]
+ end
end