X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/57209683238197d4391103ba3ca4b295a70fbb0a..0cd18eb02f853bfa93673f046b793bd53ac5aa68:/app/controllers/changesets_controller.rb diff --git a/app/controllers/changesets_controller.rb b/app/controllers/changesets_controller.rb index 928f1c1ec..d5ac49d4c 100644 --- a/app/controllers/changesets_controller.rb +++ b/app/controllers/changesets_controller.rb @@ -7,9 +7,8 @@ class ChangesetsController < ApplicationController before_action :authorize_web before_action :set_locale - before_action -> { check_database_readable(:need_api => true) }, :only => [:index, :feed, :show] + before_action -> { check_database_readable(:need_api => true) } before_action :require_oauth, :only => :show - before_action :check_database_writable, :only => [:subscribe, :unsubscribe] authorize_resource @@ -55,7 +54,7 @@ class ChangesetsController < ApplicationController elsif @params[:bbox] changesets = conditions_bbox(changesets, BoundingBox.from_bbox_params(params)) elsif @params[:friends] && current_user - changesets = changesets.where(:user => current_user.friends.identifiable) + changesets = changesets.where(:user => current_user.followings.identifiable) elsif @params[:nearby] && current_user changesets = changesets.where(:user => current_user.nearby) end @@ -107,34 +106,6 @@ class ChangesetsController < ApplicationController render :template => "browse/not_found", :status => :not_found, :layout => map_layout end - ## - # subscribe to a changeset - def subscribe - @changeset = Changeset.find(params[:id]) - - if request.post? - @changeset.subscribe(current_user) unless @changeset.subscribed?(current_user) - - redirect_to changeset_path(@changeset) - end - rescue ActiveRecord::RecordNotFound - render :action => "no_such_entry", :status => :not_found - end - - ## - # unsubscribe from a changeset - def unsubscribe - @changeset = Changeset.find(params[:id]) - - if request.post? - @changeset.unsubscribe(current_user) - - redirect_to changeset_path(@changeset) - end - rescue ActiveRecord::RecordNotFound - render :action => "no_such_entry", :status => :not_found - end - private #------------------------------------------------------------