diff options
| author | Xinhui | 2017-04-11 16:15:59 +0200 | 
|---|---|---|
| committer | Xinhui | 2017-04-11 16:15:59 +0200 | 
| commit | 43e1c3dd6a64c705b59d990973ace0f0439322ab (patch) | |
| tree | ea1afacc3b9d4e421c8af3d32d0e3f50680b37af /app/controllers/time_tables_controller.rb | |
| parent | fd99f21e549e2141d81cedbbe21ee563af3a379f (diff) | |
| download | chouette-core-43e1c3dd6a64c705b59d990973ace0f0439322ab.tar.bz2 | |
TimeTables#index fix filter by periode
Refs #2909
Diffstat (limited to 'app/controllers/time_tables_controller.rb')
| -rw-r--r-- | app/controllers/time_tables_controller.rb | 8 | 
1 files changed, 2 insertions, 6 deletions
| diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index cd682a741..eedfef07c 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -96,15 +96,11 @@ class TimeTablesController < ChouetteController      scope = select_time_tables      if params[:q] && params[:q]["tag_search"]        tags = params[:q]["tag_search"].reject {|c| c.empty?} -      if tags.any? -        # Hack to delete params can't be used by ransack -        params[:q].delete("tag_search") -        scope = select_time_tables.tagged_with(tags, :wild => true, :any => true) -      end +      params[:q].delete("tag_search") +      scope = select_time_tables.tagged_with(tags, :wild => true, :any => true) if tags.any?      end      @q = scope.search(params[:q]) -      if sort_column && sort_direction        @time_tables ||= @q.result(:distinct => true).order("#{sort_column} #{sort_direction}")      else | 
