diff options
Diffstat (limited to 'app/models/namespaces/sync_event.rb')
-rw-r--r-- | app/models/namespaces/sync_event.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/namespaces/sync_event.rb b/app/models/namespaces/sync_event.rb index fbe047f2c5a..c06d86cb297 100644 --- a/app/models/namespaces/sync_event.rb +++ b/app/models/namespaces/sync_event.rb @@ -7,9 +7,14 @@ class Namespaces::SyncEvent < ApplicationRecord belongs_to :namespace + scope :unprocessed_events, -> { all } scope :preload_synced_relation, -> { preload(:namespace) } scope :order_by_id_asc, -> { order(id: :asc) } + def self.mark_records_processed(records) + id_in(records).delete_all + end + def self.enqueue_worker ::Namespaces::ProcessSyncEventsWorker.perform_async # rubocop:disable CodeReuse/Worker end |