X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9d2342a41ab1eb6a6c2bba747bd29ff58f246258..d52c7943f24aae4ede55f1ef055af415dcf3da59:/app/controllers/changeset_subscriptions_controller.rb diff --git a/app/controllers/changeset_subscriptions_controller.rb b/app/controllers/changeset_subscriptions_controller.rb index 27872a5e8..00f5f4d20 100644 --- a/app/controllers/changeset_subscriptions_controller.rb +++ b/app/controllers/changeset_subscriptions_controller.rb @@ -11,7 +11,7 @@ class ChangesetSubscriptionsController < ApplicationController def show @changeset = Changeset.find(params[:changeset_id]) - @subscribed = @changeset.subscribed?(current_user) + @subscribed = @changeset.subscribers.include?(current_user) rescue ActiveRecord::RecordNotFound render :action => "no_such_entry", :status => :not_found end @@ -19,7 +19,7 @@ class ChangesetSubscriptionsController < ApplicationController def create @changeset = Changeset.find(params[:changeset_id]) - @changeset.subscribe(current_user) unless @changeset.subscribed?(current_user) + @changeset.subscribers << current_user unless @changeset.subscribers.include?(current_user) redirect_to changeset_path(@changeset) rescue ActiveRecord::RecordNotFound @@ -29,7 +29,7 @@ class ChangesetSubscriptionsController < ApplicationController def destroy @changeset = Changeset.find(params[:changeset_id]) - @changeset.unsubscribe(current_user) + @changeset.subscribers.delete(current_user) redirect_to changeset_path(@changeset) rescue ActiveRecord::RecordNotFound