aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/autocomplete_calendars_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/autocomplete_calendars_controller.rb b/app/controllers/autocomplete_calendars_controller.rb
index 2b85fcff3..533b5503a 100644
--- a/app/controllers/autocomplete_calendars_controller.rb
+++ b/app/controllers/autocomplete_calendars_controller.rb
@@ -2,6 +2,7 @@ class AutocompleteCalendarsController < ApplicationController
respond_to :json, :only => [:autocomplete]
def autocomplete
- @calendars = current_organisation.calendars.search(params[:q]).result.paginate(page: params[:page])
+ scope = Calendar.where('organisation_id = ? OR shared = true', current_organisation.id)
+ @calendars = scope.search(params[:q]).result.paginate(page: params[:page])
end
end