From c246e91169a0acea798fba01bfb2d9a360ac3cb0 Mon Sep 17 00:00:00 2001 From: Vlatka Pavisic Date: Mon, 2 Jan 2017 16:22:30 +0100 Subject: Refs #2265 : Calendar search by date --- app/controllers/calendars_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/controllers/calendars_controller.rb') 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 -- cgit v1.2.3