mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
19 lines
328 B
Ruby
19 lines
328 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Imports::Destroy
|
|
attr_reader :user, :import
|
|
|
|
def initialize(user, import)
|
|
@user = user
|
|
@import = import
|
|
end
|
|
|
|
def call
|
|
ActiveRecord::Base.transaction do
|
|
@import.points.delete_all
|
|
@import.destroy!
|
|
end
|
|
|
|
Stats::BulkCalculator.new(@user.id).call
|
|
end
|
|
end
|