From 8714ba7ff91c4bde4d06227f02643fa676ee572a Mon Sep 17 00:00:00 2001 From: makicamel Date: Mon, 9 Oct 2023 13:56:45 +0900 Subject: [PATCH] Add Marker#skip? --- lib/bulletmark_repairer/associations_builder.rb | 2 +- lib/bulletmark_repairer/markers.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bulletmark_repairer/associations_builder.rb b/lib/bulletmark_repairer/associations_builder.rb index 88701f4..9f58564 100644 --- a/lib/bulletmark_repairer/associations_builder.rb +++ b/lib/bulletmark_repairer/associations_builder.rb @@ -6,7 +6,7 @@ module BulletmarkRepairer class AssociationsBuilder def build(marker) # TODO: Notify if fail to find suitable file to be patched - return unless marker.index + return if marker.skip? if associations[marker.index] associations[marker.index].add(marker) diff --git a/lib/bulletmark_repairer/markers.rb b/lib/bulletmark_repairer/markers.rb index 929f255..9fdba6d 100644 --- a/lib/bulletmark_repairer/markers.rb +++ b/lib/bulletmark_repairer/markers.rb @@ -43,6 +43,10 @@ def add_association(notification) @associations += notification.instance_variable_get(:@associations) end + def skip? + index.nil? + end + def n_plus_one_in_view? @n_plus_one_in_view end