diff options
| author | Zog | 2017-12-21 15:47:29 +0100 |
|---|---|---|
| committer | Alban Peignier | 2017-12-21 21:58:56 +0100 |
| commit | be8afa7aa3fd1c8922a4e02e16cdfef698b3df26 (patch) | |
| tree | 390a90c9b243050259dd9e6ffe2e28e3943176e9 /app/controllers/referential_companies_controller.rb | |
| parent | 09f335237d39e9cce1d4051355d16f2781806cbd (diff) | |
| download | chouette-core-be8afa7aa3fd1c8922a4e02e16cdfef698b3df26.tar.bz2 | |
Refs #5361 @1H; Make company optional in Lines form
And handle the case when it is nil in the views
Diffstat (limited to 'app/controllers/referential_companies_controller.rb')
| -rw-r--r-- | app/controllers/referential_companies_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/referential_companies_controller.rb b/app/controllers/referential_companies_controller.rb index ca1ff67db..7e65a72cf 100644 --- a/app/controllers/referential_companies_controller.rb +++ b/app/controllers/referential_companies_controller.rb @@ -35,7 +35,8 @@ class ReferentialCompaniesController < ChouetteController def collection scope = referential.line_referential.companies if params[:line_id] - scope = referential.line_referential.lines.find(params[:line_id]).companies + line_scope = referential.line_referential.lines.find(params[:line_id]).companies + scope = line_scope if line_scope.exists? end @q = scope.search(params[:q]) |
