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.0.67 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.66 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.65 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.64 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.63 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.62 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.61 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.60 lib/eco/api/microcases/core_excluded.rb
eco-helpers-2.0.59 lib/eco/api/microcases/core_excluded.rb