Commit 13036f0a authored by Furkan Ayhan's avatar Furkan Ayhan

Use id_in instead of for_id

parent ea6e0b81
...@@ -9,7 +9,6 @@ class Namespaces::SyncEvent < ApplicationRecord ...@@ -9,7 +9,6 @@ class Namespaces::SyncEvent < ApplicationRecord
scope :preload_synced_relation, -> { preload(:namespace) } scope :preload_synced_relation, -> { preload(:namespace) }
scope :order_by_id_asc, -> { order(id: :asc) } scope :order_by_id_asc, -> { order(id: :asc) }
scope :for_id, -> (id) { where(id: id) }
def self.enqueue_worker def self.enqueue_worker
::Namespaces::ProcessSyncEventsWorker.perform_async # rubocop:disable CodeReuse/Worker ::Namespaces::ProcessSyncEventsWorker.perform_async # rubocop:disable CodeReuse/Worker
......
...@@ -9,7 +9,6 @@ class Projects::SyncEvent < ApplicationRecord ...@@ -9,7 +9,6 @@ class Projects::SyncEvent < ApplicationRecord
scope :preload_synced_relation, -> { preload(:project) } scope :preload_synced_relation, -> { preload(:project) }
scope :order_by_id_asc, -> { order(id: :asc) } scope :order_by_id_asc, -> { order(id: :asc) }
scope :for_id, -> (id) { where(id: id) }
def self.enqueue_worker def self.enqueue_worker
::Projects::ProcessSyncEventsWorker.perform_async # rubocop:disable CodeReuse/Worker ::Projects::ProcessSyncEventsWorker.perform_async # rubocop:disable CodeReuse/Worker
......
...@@ -33,7 +33,7 @@ module Ci ...@@ -33,7 +33,7 @@ module Ci
max = events.last max = events.last
events.each { |event| @sync_class.sync!(event) } events.each { |event| @sync_class.sync!(event) }
@sync_event_class.for_id(min.id..max.id).delete_all @sync_event_class.id_in(min.id..max.id).delete_all
end end
def enqueue_worker_if_there_still_event def enqueue_worker_if_there_still_event
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment