]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/changesets_controller.rb
Merge remote-tracking branch 'upstream/pull/5586'
[rails.git] / app / controllers / changesets_controller.rb
index 928f1c1ecf25724fa33fc9933eed9d49ded35bc4..d5ac49d4ccc04dafa68534158470872c3132f3b9 100644 (file)
@@ -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
 
   #------------------------------------------------------------