debian-mirror-gitlab/app/services/award_emojis/toggle_service.rb
2019-12-04 20:38:33 +05:30

13 lines
336 B
Ruby

# frozen_string_literal: true
module AwardEmojis
class ToggleService < AwardEmojis::BaseService
def execute
if awardable.awarded_emoji?(name, current_user)
DestroyService.new(awardable, name, current_user).execute
else
AddService.new(awardable, name, current_user).execute
end
end
end
end