diff options
| author | jpl | 2017-02-10 15:11:33 +0100 |
|---|---|---|
| committer | jpl | 2017-02-10 15:11:33 +0100 |
| commit | 405247bd09d55b66850d81dd237bab7b03a5ae10 (patch) | |
| tree | 33828f6c7eaadb5cdbaf148ce7eb10540bd7fb00 | |
| parent | 8d1ee8e038d4ec6354e163d839d38c023430920d (diff) | |
| download | chouette-core-405247bd09d55b66850d81dd237bab7b03a5ae10.tar.bz2 | |
Refs #2518: updating workbenches#show query collection
| -rw-r--r-- | app/controllers/workbenches_controller.rb | 8 |
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) |
