summaryrefslogtreecommitdiff
path: root/app/services/users/dismiss_user_callout_service.rb
blob: 96f3f3acb572ffcdff2cd0e2f378a0bc2b073691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Users
  class DismissUserCalloutService < BaseContainerService
    def execute
      callout.tap do |record|
        record.update(dismissed_at: Time.current) if record.valid?
      end
    end

    private

    def callout
      current_user.find_or_initialize_callout(params[:feature_name])
    end
  end
end