module Recordings
  class IncrementViews
    def initialize(recording)
      @recording = recording
    end

    def call
      return unless @recording.ready?

      Recording.where(id: @recording.id).update_all("view_count = view_count + 1")
      @recording.reload
    end
  end
end
