diff options
| author | vlatka pavisic | 2016-11-17 17:33:26 +0100 |
|---|---|---|
| committer | vlatka pavisic | 2016-11-17 17:33:32 +0100 |
| commit | 7efedaa1147b43a8a85e0c5eed6b512628c011db (patch) | |
| tree | bc1584787f8c3f6c8a0d2f3187bdd71ba4da7fc4 /app/controllers | |
| parent | e38d353ceb9e95aca546c962e99fb82bea7be274 (diff) | |
| download | chouette-core-7efedaa1147b43a8a85e0c5eed6b512628c011db.tar.bz2 | |
Refs #1939 : Create Line by_text scope
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/lines_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/referential_lines_controller.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index a93084012..bd1550a00 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -69,7 +69,7 @@ class LinesController < BreadcrumbController end def filtered_lines - line_referential.lines.select{ |t| [t.name, t.published_name].find { |e| /#{params[:q]}/i =~ e } } + line_referential.lines.by_text(params[:q]) end def collection diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index 165b4c262..05f80f718 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -63,7 +63,7 @@ class ReferentialLinesController < ChouetteController end def filtered_lines - referential.lines.select{ |t| [t.name, t.published_name].find { |e| /#{params[:q]}/i =~ e } } + referential.lines.by_text(params[:q]) end def collection |
