diff options
| author | Vlatka Pavisic | 2017-01-02 16:22:30 +0100 | 
|---|---|---|
| committer | Vlatka Pavisic | 2017-01-02 16:22:30 +0100 | 
| commit | c246e91169a0acea798fba01bfb2d9a360ac3cb0 (patch) | |
| tree | edaa8b88b4d0ee1c13a8add5c1efc55b2c32408e /app/controllers/calendars_controller.rb | |
| parent | 7657a10c7c4b126cdaabb779657e9a5270fc729d (diff) | |
| download | chouette-core-c246e91169a0acea798fba01bfb2d9a360ac3cb0.tar.bz2 | |
Refs #2265 : Calendar search by date
Diffstat (limited to 'app/controllers/calendars_controller.rb')
| -rw-r--r-- | app/controllers/calendars_controller.rb | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index 563c126e4..afa4c129c 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -4,7 +4,7 @@ class CalendarsController < BreadcrumbController    private    def calendar_params -    params.require(:calendar).permit(:id, :name, :short_name, :shared, ranges_attributes: [:id, :begin, :end, :_destroy], dates: []) +    params.require(:calendar).permit(:id, :name, :short_name, :shared, periods_attributes: [:id, :begin, :end, :_destroy], dates: [])    end    def sort_column @@ -35,6 +35,7 @@ class CalendarsController < BreadcrumbController      @q = current_organisation.calendars.search(params[:q])      calendars = @q.result(distinct: true) +    ap "FILTERED COLLECTION LENGTH : #{@q.result.length}"      calendars = calendars.order(sort_column + ' ' + sort_direction) if sort_column && sort_direction      @calendars = calendars.paginate(page: params[:page])    end | 
