Sha256: 5a78f445bbe65db333e6a7f99ae660fa34715d75cf53bd620e79cd900b3c56fd

Contents?: true

Size: 673 Bytes

Versions: 110

Compression:

Stored size: 673 Bytes

Contents

module Eco
  module API
    class MicroCases
      # It preserves the usergroups of `person` and appends those defined in `policy_group_ids` of the `entry`
      # @param entry [PersonEntry] the input entry with the data we should set on person.
      # @param person [Ecoportal::API::V1::Person] the person we want to update, carrying the changes to be done.
      # @param options [Hash] the options.
      def append_usergroups(entry, person, options)
        unless options.dig(:exclude, :account)
          if person.account
            person.account.policy_group_ids |= entry.policy_group_ids
          end
        end
      end

    end
  end
end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
eco-helpers-2.6.1 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.6.0 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.10 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.9 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.8 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.7 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.6 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.5 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.4 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.3 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.2 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.5.1 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.9 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.8 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.7 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.6 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.5 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.4 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.3 lib/eco/api/microcases/append_usergroups.rb
eco-helpers-2.4.2 lib/eco/api/microcases/append_usergroups.rb