summaryrefslogtreecommitdiff
path: root/app/controllers/gs_parameters_controller.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-04 10:41:59 -0500
committerPeter Kozak <spag@golwen.net>2013-03-04 10:41:59 -0500
commit45fe4f5022f7181aa5d6e66f03ba3c8cf281879a (patch)
treef53b0320ca57ac5ea9edfd4867bd2635c531d250 /app/controllers/gs_parameters_controller.rb
parentc5ab74f9adb52228ef6583353b89d855f0dc4a3a (diff)
sort gs_parameters by entity+section
Diffstat (limited to 'app/controllers/gs_parameters_controller.rb')
-rw-r--r--app/controllers/gs_parameters_controller.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb
index bd8b44b..106ce76 100644
--- a/app/controllers/gs_parameters_controller.rb
+++ b/app/controllers/gs_parameters_controller.rb
@@ -4,9 +4,15 @@ class GsParametersController < ApplicationController
before_filter :spread_breadcrumbs
def index
- @gs_parameters_unordered = GsParameter.scoped
- @gs_parameters = GsParameter.order([:section, :name])
- @sections = @gs_parameters.pluck(:section).uniq.sort
+ @gs_parameters = GsParameter.order([:entity, :section, :name])
+
+ @entities = Hash.new()
+ @gs_parameters.each do |parameter|
+ if !@entities[parameter.entity]
+ @entities[parameter.entity] = Hash.new()
+ end
+ @entities[parameter.entity][parameter.section] = true
+ end
end
def show