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