diff options
| author | Xinhui | 2017-02-17 10:52:22 +0100 |
|---|---|---|
| committer | Xinhui | 2017-02-17 10:52:22 +0100 |
| commit | 1e6784efab6d3fdbf71bba9f271c40ffec1e88a9 (patch) | |
| tree | 58e2cc3e1a05ae3cd6c2e1071055eabcd7080547 /app/controllers/workbenches_controller.rb | |
| parent | 630d6c162a937f83681553da4cfe32e80e2519df (diff) | |
| download | chouette-core-1e6784efab6d3fdbf71bba9f271c40ffec1e88a9.tar.bz2 | |
Fix query condition on workbench#show
Diffstat (limited to 'app/controllers/workbenches_controller.rb')
| -rw-r--r-- | app/controllers/workbenches_controller.rb | 4 |
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) |
