app/controllers/concepts/hierarchical_controller.rb in iqvoc-4.1.0 vs app/controllers/concepts/hierarchical_controller.rb in iqvoc-4.1.1
- old
+ new
@@ -1,8 +1,8 @@
# encoding: UTF-8
-# Copyright 2011 innoQ Deutschland GmbH
+# Copyright 2011-2013 innoQ Deutschland GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@@ -20,11 +20,11 @@
authorize! :read, Iqvoc::Concept.base_class
scope = Iqvoc::Concept.base_class
scope = params[:published] == "0" ? scope.editor_selectable : scope.published
- #collect only the not expired concepts
+ # only select unexpired concepts
scope = scope.not_expired
# if params[:broader] is given, the action is handling the reversed tree
root_id = params[:root]
if root_id && root_id =~ /\d+/
@@ -52,21 +52,10 @@
a.pref_label.to_s <=> b.pref_label.to_s
end
respond_to do |format|
format.html
- format.json do # Treeview data
- @concepts.map! do |c|
- {
- :id => c.id,
- :url => concept_path(:id => c, :format => :html),
- :text => CGI.escapeHTML(c.pref_label.to_s),
- :hasChildren => (params[:broader] ? c.broader_relations.any? : c.narrower_relations.any?),
- :additionalText => (" (#{c.additional_info})" if c.additional_info.present?)
- }
- end
- render :json => @concepts.to_json
- end
+ format.json # Treeview data
end
end
end