aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-07-04 16:06:17 +0200
committerXinhui2017-07-04 16:06:17 +0200
commite9f0dc0a0a5ede199158c6b035e192c555621894 (patch)
tree3a9ee45c1e4dae35d1c50606897586341a74927e
parente7bea6f00bbd5f2b03db37f5ea44b8098adbadf2 (diff)
downloadchouette-core-e9f0dc0a0a5ede199158c6b035e192c555621894.tar.bz2
Fix autocomplete_calendars_path should also return shared calendar
Refs #3954
-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