aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpl2017-02-10 15:11:33 +0100
committerjpl2017-02-10 15:11:33 +0100
commit405247bd09d55b66850d81dd237bab7b03a5ae10 (patch)
tree33828f6c7eaadb5cdbaf148ce7eb10540bd7fb00
parent8d1ee8e038d4ec6354e163d839d38c023430920d (diff)
downloadchouette-core-405247bd09d55b66850d81dd237bab7b03a5ae10.tar.bz2
Refs #2518: updating workbenches#show query collection
-rw-r--r--app/controllers/workbenches_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index b15765fdb..ea55820d0 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -3,7 +3,13 @@ class WorkbenchesController < BreadcrumbController
respond_to :html, :only => [:show]
def show
- scope = Workbench.find(params[:id]).all_referentials
+ scope = Workbench.find(params[:id])
+ if params[:q] and params[:q][:organisation_name_eq_any].include? current_organisation.name
+ scope = scope.referentials.ready
+ else
+ scope = scope.all_referentials
+ end
+
@q = scope.ransack(params[:q])
@collection = @q.result(distinct: true)