Sha256: 3b7b807bccab7f8d3429bfd51c0294b8b7025c5e7c0891b672a7a6e730d7fd92

Contents?: true

Size: 677 Bytes

Versions: 40

Compression:

Stored size: 677 Bytes

Contents

class Eco::API::UseCases::GraphQL::Helpers::Location::Command::Diffs
  module Stages
    module DiffSortable
      module ForArchive

        private

        def only_first_ancestor_in_chains(raw_diffs)
          parents = raw_diffs.each_with_object({}) do |dff, prs|
            (prs[dff.parent_id_prev] ||= []) << dff
          end

          present_parent_prev_ids = raw_diffs.select do |dff|
            parents.key?(dff.node_id_prev)
          end.map(&:node_id_prev)

          children_with_parents = parents.values_at(*present_parent_prev_ids).flatten(1).uniq
          raw_diffs - children_with_parents
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
eco-helpers-3.0.21 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.20 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.19 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.18 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.17 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.16 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.15 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.14 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.13 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.12 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.11 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.10 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.9 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.8 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.7 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.6 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.5 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.4 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.3 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb
eco-helpers-3.0.2 lib/eco/api/usecases/graphql/helpers/location/command/diffs/stages/diff_sortable/for_archive.rb