aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/workbenches_controller.rb
diff options
context:
space:
mode:
authorXinhui2017-02-17 10:52:22 +0100
committerXinhui2017-02-17 10:55:34 +0100
commit7d6609313bf0a00d6e9f1ce80852b72bb7a46c42 (patch)
treec5cd22454def540128555afcc4e7aff872a7906c /app/controllers/workbenches_controller.rb
parent3be888bbf65f92cf52321e8cde2dc1af437000a0 (diff)
downloadchouette-core-7d6609313bf0a00d6e9f1ce80852b72bb7a46c42.tar.bz2
Fix query condition on workbench#show
Diffstat (limited to 'app/controllers/workbenches_controller.rb')
-rw-r--r--app/controllers/workbenches_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index da57268ec..1626ae039 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -3,7 +3,9 @@ class WorkbenchesController < BreadcrumbController
respond_to :html, :only => [:show]
def show
- @q = Workbench.find(params[:id]).all_referentials.ransack(params[:q])
+ scope = Workbench.find(params[:id])
+ scope = params[:q] ? scope.all_referentials : scope.referentials.ready
+ @q = scope.ransack(params[:q])
@q.organisation_name_eq_any ||= current_organisation.name unless params[:q]
@collection = @q.result(distinct: true)