Sha256: bc392ec8d2dfdfacaae5ab316810e6251f3bca28e049b583550de5813338838b

Contents?: true

Size: 753 Bytes

Versions: 69

Compression:

Stored size: 753 Bytes

Contents

module Eco
  module API
    class MicroCases
      # @note by default `supervisor_id` is always excluded.
      # @param person [Ecoportal::API::V1::Person] the person we want to update, carrying the changes to be done.
      # @param options [Hash] the options.
      # @return [Array<String>] the core parameters that should not be included.
      def core_excluded(person, options)
        ["supervisor_id"].tap do |core_excluded|
          can_exclude = person.new?? ["filter_tags"] : ["name", "external_id", "email", "filter_tags"]
          exclusions  = can_exclude.select do |attr|
            options.dig(:exclude, attr.to_sym)
          end
          core_excluded.concat(exclusions)
        end
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
eco-helpers-2.7.24 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.23 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.22 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.21 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.20 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.19 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.18 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.17 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.16 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.15 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.14 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.13 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.12 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.4 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.2 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.1 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.7.0 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.6.4 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.6.3 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.6.2 lib/eco/api/microcases/core_excluded.rb