debian-mirror-gitlab/app/controllers/concerns/toggle_subscription_action.rb
2016-06-02 11:05:42 +05:30

17 lines
283 B
Ruby

module ToggleSubscriptionAction
extend ActiveSupport::Concern
def toggle_subscription
return unless current_user
subscribable_resource.toggle_subscription(current_user)
head :ok
end
private
def subscribable_resource
raise NotImplementedError
end
end