update_service.rb 239 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4 5 6 7
module Badges
  class UpdateService < Badges::BaseService
    # returns the updated badge
    def execute(badge)
      if params.present?
Lin Jen-Shin's avatar
Lin Jen-Shin committed
8
        badge.update(params)
9 10 11 12 13 14
      end

      badge
    end
  end
end