lib/table_sync/publishing/helpers/debounce.rb in table_sync-6.0.3 vs lib/table_sync/publishing/helpers/debounce.rb in table_sync-6.0.4

- old
+ new

@@ -61,11 +61,11 @@ @object_class = object_class @needle = needle end def skip? - true if sync_in_the_future? && upsert_event? # case 3.1 + sync_in_the_future? && upsert_event? # case 3.1 end memoize def next_sync_time return current_time if debounce_time.zero? # case 0 return current_time if no_sync_before? # case 1 @@ -85,19 +85,19 @@ def sync_in_the_past? cached_sync_time <= current_time end def debounce_time_passed? - cached_sync_time + debounce_time.seconds >= current_time + cached_sync_time + debounce_time.seconds <= current_time end def debounce_time_not_passed? - cached_sync_time + debounce_time.seconds < current_time + cached_sync_time + debounce_time.seconds > current_time end # CASE 3 def sync_in_the_future? - cached_sync_time && (cached_sync_time > current_time) + !!cached_sync_time && (cached_sync_time > current_time) end def destroy_event? event == :destroy end