debian-mirror-gitlab/app/controllers/concerns/toggle_subscription_action.rb

18 lines
283 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
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